PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » File Formats » Spreadsheet_Excel_Writer » Bug #8967

Excel XP crashes when generated worksheet have many cell merges

Details

Submitted2006-10-11 12:53 UTC
Frompaladin80 at gmail dot com
StatusVerified
PackageSpreadsheet_Excel_Writer
PHP Version5.0.4
OSwin XP
Roadmaps(Not assigned)

Comments

[2006-10-11 12:53 UTC] paladin80 at gmail dot com

Description:
------------
Excel XP crashes when generated worsheet have many column merges.
Merges are become bugous when spreadsheet have about 400 of them. When count of merges is more than 700, Excel XP crushes.

Test script:
---------------
<?php
include_once "Spreadsheet/Excel/Writer.php";
$xls =& new Spreadsheet_Excel_Writer();
$xls->send("table.xls");
$sheet =& $xls->addWorksheet('table');
for($i=0; $i<40; $i++){//change to $i<100 to get excel crush
for($j=0;$j<20;$j+=2){
$sheet->setMerge($i, $j, $i, $j+1);
}
}
$xls->close();
?>

Expected result:
----------------
A blank table, each cell must have colspan=2 and rowspan=1.

Actual result:
--------------
A blank table, each cell have colspan=2, but many cells from column "M" have rowspan=2.

When I extend the table up to 100 rows, I get the excel crush.

[2006-10-11 13:48 UTC] paladin80 at gmail dot com

Just avoided problem by using mergeCells() instead of setMerge().