Re: Structures_DataGrid_Renderer_XLS: I just get empty files
| From: | Markus Ernst | Date: | Mon, 12 Mar 2007 13:16:43 +0000 |
| Subject: | Re: Structures_DataGrid_Renderer_XLS: I just get empty files | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-26824@lists.php.net to get a copy of this message | ||
(Michael Mauch) schrieb:
Markus Ernst wrote:[code snipped]Do you think I should file a bug with this info? If yes, does it belong to Structures_DataGrid_Renderer_XLS or rather to Spreadsheet_Excel_Writer?Yes, I think you should file a bug report, but I'm not sure for which one. I see the same problem with Spreadsheet_Excel_Writer alone:
There the problem is at line 198.Thank you, I used your code for the bug report. Anyway I found several bugs on this same topic, so I did not file a new one, but added it to bug #2010.
If I omit that $workbook->setVersion(8), it works. Alas, setVersion() is
not documented on
http://pear.php.net/manual/en/package.fileformats.spreadsheet-excel-writer.php
and I can see in Spreadsheet/Excel/Writer/Workbook.php:
/**
* Sets the BIFF version.
* This method exists just to access experimental functionality
* from BIFF8. It will be deprecated !
* Only possible value is 8 (Excel 97/2000).
* For any other value it fails silently.
*
* @access public
* @param integer $version The BIFF version
*/
function setVersion($version)
On the other hand, Structures/DataGrid/Renderer/XLS.php has a line
$this->_workbook->setVersion(8);
And there's apparently no way to turn that off. Probably you really want
setVersion(8), because you wrote it in your example.
setVersion(8) seems to be necessary to make multibyte encodings work, if I omit it, the XLS file does not break (as you mention above), but non-ASCII characters are not properly encoded. It looks like so far Spreadsheet_Excel_Writer (and along with it, Structures_DataGrid_Renderer_XLS) is not applicable in UTF-8 environments, let's hope they get it fixed soon!