Introduction
Typical usage
<?php
require_once 'Spreadsheet/Excel/Writer.php';
// Creating a workbook
$workbook = new Spreadsheet_Excel_Writer();
// sending HTTP headers
$workbook->send('test.xls');
// Creating a worksheet
$worksheet =& $workbook->addWorksheet('My first worksheet');
// The actual data
$worksheet->write(0, 0, 'Name');
$worksheet->write(0, 1, 'Age');
$worksheet->write(1, 0, 'John Smith');
$worksheet->write(1, 1, 30);
$worksheet->write(2, 0, 'Johann Schmidt');
$worksheet->write(2, 1, 31);
$worksheet->write(3, 0, 'Juan Herrera');
$worksheet->write(3, 1, 32);
// Let's send the file
$workbook->close();
?>
Installation
Download OLE-1 (required package) from Doqnload OLE-1 to c:\Downloads\pear folder
Download Spreadsheet_Excel_Writer from Spreadsheet_Excel_Writer to c:\Downloads\pear folder
If pear fails to install due to Tar.php error, change:
$v_att_list = & func_get_args();
to
$v_att_list = func_get_args();
see: pear
Install OLE-1 (required package) from cmd window:
pear install c:\Downloads\pear\OLE-1.0.0RC3.tgz
Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in PEAR\PackageFile\v2\Validator.php on line 1933
PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in C:\xampp\php\pear\PEAR\PackageFile\v2\Validator.php on line 1933
Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in C:\xampp\php\pear\PEAR\PackageFile\v2\Validator.php on line 1933
install ok: channel://pear.php.net/OLE-1.0.0RC3
Install Spreadsheet_Excel_Writer from cmd window:
pear install c:\Downloads\pear\Spreadsheet_Excel_Writer-0.9.4.tgz
Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in PEAR\PackageFile\v2\Validator.php on line 1933
PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in C:\xampp\php\pear\PEAR\PackageFile\v2\Validator.php on line 1933
Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in C:\xampp\php\pear\PEAR\PackageFile\v2\Validator.php on line 1933
Package “pear.php.net/Spreadsheet_Excel_Writer” dependency “pear.php.net/OLE” has no releases
install ok: channel://pear.php.net/Spreadsheet_Excel_Writer-0.9.4