Print Page Header Setting

Topics: Developer Forum, Project Management Forum, User Forum
Sep 22, 2009 at 1:38 PM
Edited Sep 22, 2009 at 1:43 PM


I have created a excel file through this library. While I am trying print preview one excel sheet it is showing in multiple pages. So I want to set the first 3 row to the page header in every print page. Anyone have any idea.

I have found some coding...

$objPHPExcel->getActiveSheet()->getHeaderFooter()->setOddHeader('Testing Header');


But here you can only able to set some fixed test. I want to set some cells range as the header in all printing page.


Thanks in advance.

Sep 22, 2009 at 3:04 PM

What you want is called repeating rows. Here is the code you need:


Sep 22, 2009 at 3:33 PM



Thank you very much for your quick reply. I have fixed this by using the code...

$objPageSetup->setRowsToRepeatAtTop(array(2, 4));