"Fossies" - the Fresh Open Source Software Archive

Member "php_writeexcel-0.3.0/example-repeat.php" (1 Nov 2005, 712 Bytes) of package /linux/www/old/php_writeexcel-0.3.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "example-repeat.php" see the Fossies "Dox" file reference documentation.

    1 <?php
    2 
    3 set_time_limit(10);
    4 
    5 require_once "class.writeexcel_workbook.inc.php";
    6 require_once "class.writeexcel_worksheet.inc.php";
    7 
    8 $fname = tempnam("/tmp", "repeat.xls");
    9 $workbook = &new writeexcel_workbook($fname);
   10 $worksheet = &$workbook->addworksheet();
   11 
   12 $worksheet->repeat_rows(0, 1);
   13 
   14 $worksheet->write(0, 0, "Header line (will be repeated when printed)");
   15 $worksheet->write(1, 0, "Header line number 2");
   16 
   17 for ($i=1;$i<=100;$i++) {
   18   $worksheet->write($i+1, 0, "Line $i");
   19 }
   20 
   21 $workbook->close();
   22 
   23 header("Content-Type: application/x-msexcel; name=\"example-repeat.xls\"");
   24 header("Content-Disposition: inline; filename=\"example-repeat.xls\"");
   25 $fh=fopen($fname, "rb");
   26 fpassthru($fh);
   27 unlink($fname);
   28 
   29 ?>