 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
kmm12
Joined: 15 Jan 2009 Posts: 2
|
Posted: Fri Jan 16, 2009 12:13 pm Post subject: PHP5 / PEAR - Spreadsheet_Excel_Writer |
|
|
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 |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1230
|
Posted: Fri Jan 16, 2009 1:54 pm Post subject: Re: PHP5 / PEAR - Spreadsheet_Excel_Writer |
|
|
| 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 |
|
 |
kmm12
Joined: 15 Jan 2009 Posts: 2
|
Posted: Mon Jan 19, 2009 11:40 am Post subject: |
|
|
| it's working, thanks a lot |
|
| Back to top |
|
 |
|
|
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
|
|