/home/mjc1/public_html/manage/writeexcel/example-bigfile.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
<?php

set_time_limit
(300);

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

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

$worksheet->set_column(05018);

for (
$col=0;$col<50;$col++) {
    for (
$row=0;$row<6000;$row++) {
        
$worksheet->write($row$col"ROW:$row COL:$col");
    }
}

$workbook->close();

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

?>