previousWorksheet::setMarginBottom (Previous) (Next) Worksheet::repeatColumnsnext

View this page in Last updated: Tue, 02 Jun 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

Worksheet::repeatRows

Worksheet::repeatRows – Set the rows to repeat at the top of each printed page.

Synopsis

require_once "Spreadsheet/Excel/Writer.php";

void Worksheet::repeatRows ( integer $first_row , integer $last_row=NULL )

Description

Set the rows to repeat at the top of each printed page.

Parameter

  • integer $first_row - First row to repeat

  • integer $last_row - Last row to repeat. Optional.

Note

This function can not be called statically.

Example

Using repeatRows()

<?php
  
require_once 'Spreadsheet/Excel/Writer.php';

  
$workbook = new Spreadsheet_Excel_Writer('test.xls');
  
$worksheet =& $workbook->addWorkSheet();
  
$worksheet->setColumn(0,0,100);
  
$worksheet->write(0,0,"99 Bottles Of Beer On The Wall- The Complete Lyrics");
  
// repeat only the first row
  
$worksheet->repeatRows(0);
  for (
$i 99$i 0$i--)
  {
      if (
$i 1) {
          
$next $i 1;
      }
      else {
          
$next "no more";
      }
      
$worksheet->write(100 $i,0,"$i Bottles of beer on the wall, $i bottles of beer, ".
                                   
"take one down, pass it around, ".
                                   
"$next bottles of beer on the wall.");
  }
  
$workbook->close();
?>
previousWorksheet::setMarginBottom (Previous) (Next) Worksheet::repeatColumnsnext

Download Documentation Last updated: Tue, 02 Jun 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
Note by: alexanderguevara@gmail.com
As pointman mentioned, i am having problems with this function.

Is there any workaround to make it work?

Regards
Note by: pointman@rsvs.net

If Excel complains your workbook is corrupt, do you want to recover, and you're using setVersion(8), try disabling repeatRows().

Using 0.91 and had this issue with Excel >= ver 2000 (all that was tested)