Lost repeat row setting in PHPExcel_Writer_Excel5

Topics: Developer Forum, User Forum
Jun 25, 2008 at 9:06 PM
Edited Jun 25, 2008 at 9:09 PM
I created an 2007 Excel template file, with repeat row setting inside.  ( I repeat Row 1 to 15)
I used the PHPExcel_Reader_Excel2007 to read and then write it to Excel 2003 immediately.
Finally, the Excel 2003 file missing the Repeat Row setting.

This is my code:
$objReader = new PHPExcel_Reader_Excel2007();
$objPHPExcel  = $objReader->load("spec_template.xlsx");  

$objWriter = new PHPExcel_Writer_Excel5($objPHPExcel);  

After that, I tried to use $objPHPExcel->getActiveSheet()->getPageSetup()->setRowsToRepeatAtTopByStartAndEnd(1, 15);        
Failed Aslo.

It is fine if I output to Excel 2007 file.

Is any bugs inside PHPExcel_Writer_Excel5?

My Development environment:
PHPExcel 1.6.2
Fedora 9
php 5.2.6
PEAR 1.7.2
Spreadsheet_Excel_Writer 0.9.1

Jun 26, 2008 at 7:17 AM
That's not implemented. I've created a work item for this http://www.codeplex.com/PHPExcel/WorkItem/View.aspx?WorkItemId=6485
Jun 26, 2008 at 9:59 AM
Thanks for your quick reply.

I still have 3 questions

1. $phpSheet->getPageSetup()->isRowsToRepeatAtTopSet() always get false ( the repeat row set in Excel template)
This function only works when   I add  $objPHPExcel->getActiveSheet()->getPageSetup()->setRowsToRepeatAtTopByStartAndEnd(1, 2);  in my code.

2. it should be $worksheet->repeatRows($repeat[0] -1, $repeat[1] - 1);

3. $worksheet->repeatRows always crash the generated Excel. All format and setting have been lost
Oct 11, 2008 at 11:16 PM

Has this been fixed?  I am unable to get rows to repeat at top using PHPExcel 1.6.3 (PHPExcel_Writer_Excel5)

My code is:
$objPHPExcel = new PHPExcel();
.... add data to worksheet....
$objPHPExcel->getActiveSheet()->getPageSetup()->setRowsToRepeatAtTopByStartAndEnd(1, 2);

$objWriter = new PHPExcel_Writer_Excel5($objPHPExcel);

... but no rows repeat at top?

Oct 12, 2008 at 1:53 AM
Support for repeating rows and print area was implemented for PHPExcel_Writer_Excel5, but had to be removed again due to the these bugs for PEAR Spreadsheet_Excel_Writer


(PHPExcel_Writer_Excel5 is based on PEAR Spreadsheet_Excel_Writer)
I just looked at the relevant portions of the code and I now see what the problem is. Unfortunately it's not just a tiny problem, but I'll see what I can do about this although it may take time. Subscribe to this thread, and I'll post back when there is something ready.

Oct 17, 2008 at 3:57 AM
Update: Fixed per work item 7834