/home/mjc1/public_html/manage/writeexcel/example-repeat.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php

set_time_limit
(10);

require_once 
"class.writeexcel_workbook.inc.php";
require_once 
"class.writeexcel_worksheet.inc.php";

$fname tempnam("/tmp""repeat.xls");
$workbook = &new writeexcel_workbook($fname);
$worksheet = &$workbook->addworksheet();

$worksheet->repeat_rows(01);

$worksheet->write(00"Header line (will be repeated when printed)");
$worksheet->write(10"Header line number 2");

for (
$i=1;$i<=100;$i++) {
  
$worksheet->write($i+10"Line $i");
}

$workbook->close();

header("Content-Type: application/x-msexcel; name=\"example-repeat.xls\"");
header("Content-Disposition: inline; filename=\"example-repeat.xls\"");
$fh=fopen($fname"rb");
fpassthru($fh);
unlink($fname);

?>