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 
PHP5 / PEAR - Spreadsheet_Excel_Writer

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



Joined: 15 Jan 2009
Posts: 2

PostPosted: Fri Jan 16, 2009 12:13 pm    Post subject: PHP5 / PEAR - Spreadsheet_Excel_Writer Reply with quote

I am trying to add functionality of excel file generating from the level of the PHP application. I decided to use PEAR. It looks that everything is installed and configured correctly, all components work together, all paths are set fine, can use excel class from the level of PHP scripts, there are no errorr messages.

The problem is that the excel is not opening. instead of it some kind of text output is displayed in browser window.

The standard code used to generate this file is mentioned below:

include_once 'Spreadsheet/Excel/Writer.php';
$workbook = new Spreadsheet_Excel_Writer();

$workbook->send('test.xls');

$worksheet =& $workbook->addWorksheet('Sheet1');

$worksheet->write(0, 0, 'Name');
$worksheet->write(0, 1, 'Age');
$worksheet->write(1, 0, 'John Smith);
$worksheet->write(1, 1, '30');

$workbook->close();

Did anyone met with problem like this?
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1235

PostPosted: Fri Jan 16, 2009 1:54 pm    Post subject: Re: PHP5 / PEAR - Spreadsheet_Excel_Writer Reply with quote

kmm12 wrote:
The problem is that the excel is not opening. instead of it some kind of text output is displayed in browser window.


Do you see some binary data in the browser window? It's very likely then that you have some characters outputted before Spreadsheet_Excel_Writer can send the necessary headers for Excel. E.g. some linebreaks before the opening php tag (<?php) or maybe the UTF-8 BOM.
Back to top
View user's profile Send private message
kmm12



Joined: 15 Jan 2009
Posts: 2

PostPosted: Mon Jan 19, 2009 11:40 am    Post subject: Reply with quote

it's working, thanks a lot
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> PEAR 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