PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Spreadsheet_Excel_Writer and Windows Server 2003

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> File Formats
View previous topic :: View next topic  
Author Message
w1n78



Joined: 12 Aug 2008
Posts: 2

PostPosted: Tue Aug 12, 2008 3:43 am    Post subject: Spreadsheet_Excel_Writer and Windows Server 2003 Reply with quote

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.
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1003

PostPosted: Tue Aug 12, 2008 10:07 am    Post subject: Reply with quote

short_open_tags seem to be disabled. Replace "<?" by "<?php" in your code, and it should work.
Back to top
View user's profile Send private message
w1n78



Joined: 12 Aug 2008
Posts: 2

PostPosted: Tue Aug 12, 2008 10:17 am    Post subject: thank you!!! Reply with quote

mark wrote:
short_open_tags seem to be disabled. Replace "<?" by "<?php" in your code, and it should work.


thank you very much, that fixed it. i don't know how i missed that Embarassed
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> File Formats All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software