w1n78
Joined: 12 Aug 2008 Posts: 2
|
Posted: Tue Aug 12, 2008 3:43 am Post subject: Spreadsheet_Excel_Writer and Windows Server 2003 |
|
|
Has anyone gotten this combo to work? When I try to load the page, all
it displays is the code as if PHP isn't installed. PHP5 is working
properly and other Pear packages are working. Is there something I
need to do with Windows? Any ideas? If anyone has gotten it to work,
can you give me a sample code? The same code works on another server - Windows Server 2000 and PHP4.
| Code: | <?
// Report all errors except E_NOTICE
#error_reporting(E_ALL ^ E_NOTICE);
require_once "Spreadsheet/Excel/Writer.php";
// variable for spreadsheet
$workbook = new Spreadsheet_Excel_Writer();
$worksheet =& $workbook->addworksheet('Duplicate Records');
// variable for headings
$titleFormat =& $workbook->addFormat();
$titleFormat->setFontFamily('Arial');
$titleFormat->setBold();
$titleFormat->setBottom(2);
$titleFormat->setBottomColor('black');
$titleFormat->setAlign('center');
// write out the titles
$worksheet->write(0,0,"",$titleFormat);
$worksheet->write(0,1,"Username",$titleFormat);
$worksheet->write(0,2,"Password",$titleFormat);
$worksheet->write(0,3,"First Name",$titleFormat);
$worksheet->write(0,4,"Last Name",$titleFormat);
$worksheet->write(0,5,"Groupname",$titleFormat);
$worksheet->write(0,6,"District",$titleFormat);
$worksheet->write(0,7,"School",$titleFormat);
$worksheet->write(0,8,"Title",$titleFormat);
$worksheet->write(0,9,"Years Teaching",$titleFormat);
$worksheet->write(0,10,"Grade",$titleFormat);
$workbook->send('duplicate_records.xls');
$workbook->close();
?> |
When the page is loaded, I get the following...
| Quote: |
addworksheet('Duplicate Records'); // variable for headings $titleFormat =& $workbook->addFormat(); $titleFormat->setFontFamily('Arial'); $titleFormat->setBold(); $titleFormat->setBottom(2); $titleFormat->setBottomColor('black'); $titleFormat->setAlign('center'); // write out the titles $worksheet->write(0,0,"",$titleFormat); $worksheet->write(0,1,"Username",$titleFormat); $worksheet->write(0,2,"Password",$titleFormat); $worksheet->write(0,3,"First Name",$titleFormat); $worksheet->write(0,4,"Last Name",$titleFormat); $worksheet->write(0,5,"Groupname",$titleFormat); $worksheet->write(0,6,"District",$titleFormat); $worksheet->write(0,7,"School",$titleFormat); $worksheet->write(0,8,"Title",$titleFormat); $worksheet->write(0,9,"Years Teaching",$titleFormat); $worksheet->write(0,10,"Grade",$titleFormat); $workbook->send('duplicate_records.xls'); $workbook->close(); ?> |
Has anyone run into this? Please help. |
|