you will need to enable the library, otherwise PHP will not recognize the Spreadsheet_Excel_Writer class.
And you also need to specify the path for include_path, not the file. And it is usually best to add a new path to an existing path. So first you will need to restore the current include_path and add a new path to this.
This should work:
<?php
ini_set('include_path',ini_get('include_path').':/xhome/rekha/public_html/PHP_FORUM/PHP/open_office/Spreadsheet_Excel_Writer-0.9.2/');
require_once 'Spreadsheet/Excel/Writer.php';
$workbook = new Spreadsheet_Excel_Writer();
$workbook->send('grades.xls');
$format_bold =& $workbook->addFormat();
$format_bold->setBold();
$worksheet =& $workbook->addWorksheet();
$worksheet->write(0, 0, "NAME", $format_bold);
$worksheet->write(0, 1, "MARK1", $format_bold);
$worksheet->write(0, 2, "MARK2", $format_bold);
$worksheet->write(0, 3, "MARK3", $format_bold);
$worksheet->write(0, 4, "MARK4", $format_bold);
$worksheet->write(0, 5, "MARK5", $format_bold);
$worksheet->write(0, 6, "TOTAL", $format_bold);
$workbook->close();
?>
, , Spreadsheet_Excel_Writer .
PEAR, PHP, . PEAR , include_path. , require_once. include_path.
:
pear install Spreadsheet_Excel_Writer-beta
, PEAR, ini_set script.
, .
PEAR:
http://pear.php.net/manual/en/guide.users.commandline.cli.php