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 #1286

setHPageBreaks( array) Only adds the first entered break

Details

Submitted2004-04-26 16:02 UTC
Frommisc at windstreak dot com
Assignedxnoguer
StatusClosed
PackageSpreadsheet_Excel_Writer
PHP Version4.3.4
OSFreeBSD
Roadmaps(Not assigned)

Comments

[2004-04-26 16:02 UTC] misc at windstreak dot com

Description:
------------
If I call the function setHPageBreaks(array(1,2,3,4,5,6)) only row 1 will have a page break. All the others will be left out. The same problem occured with setVPageBreaks( array ). Only the first item in the array is implemented in the spreadsheet.
I'm running 0.7b and tried it on two systems (FreeBSD/php4.3.4) and (Debian / php4.1.0) with the same results in both OpenOffice and MS Excel.

Thanks,

Reproduce code:
---------------
<?php
require_once("Spreadsheet/Excel/Writer.php");
$row = 0;
$spreadcol = 0;
$xls =& new Spreadsheet_Excel_Writer();
$xls->send("salescallReport.xls");

$sheet =& $xls->addWorksheet('Page Break Worksheet');
for($i=0;$i<50;$i++)
{
$header = "Welcome to my page break test";
$sheet->write($row,0,$header);
$row++;
$sheet->setHPageBreaks(array($row));
}
$xls->close();
?>

Expected result:
----------------
To get a page break after every row.

Actual result:
--------------
I only see a page break between line 1 and 2

[2004-04-26 16:35 UTC] misc at windstreak dot com

I applied the changes for the VPageBreaks Bug and there was a fix for the HPageBreaks as well and I got it working.
I have no issue with this problem anymore.

[2004-05-20 20:46 UTC] peter dot j dot johnson at att dot net

What is the fix mentioned, please? I looked at the code in worksheet.php, and it seems like it should work, but it doesn't. I tried workbook->setVersion(8) (mentioned in the similar setVPageBreaks() bug) but that results in a spreadsheet that Excel 2000 won't open.

[2004-06-22 23:49 UTC] xnoguer at php dot net

This bug has been fixed in CVS.nnIn case this was a documentation problem, the fix will show up at thenend of next Sunday (CET) on pear.php.net.nnIn case this was a pear.php.net website problem, the change will shownup on the website in short time.n nThank you for the report, and for helping us make PEAR better.

This one was fixed together with setVPageBreaks().