|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Spreadsheet_Excel_Writer setVersion - does nothing for me...
Hello!
I'm not sure that setVersion() in the Spreadsheet_Excel_Writer does much at all, does it? Well, I don't understand the BIFF thing anyway, but it doesn't behave like I was expecting and I'm wondering if I'm doing something wrong (or if the package is). I've generated a spreadsheet using Spreadsheet_Excel_Writer with no problem and this is sent to the browser as required. However, when I click "save as", the default version is "Microsoft Excel 5.0", not "Excel 97/2000" as promised in the doc would happen if I setVersion(8). The version drop-down must be manually selected and changed within the file-save dialogue. (okay, i admit it's not a massive problem, but the client has requested it to avoid possible human-errors). I get this Excel 5.0 regardless of whether I'm opting to setVersion(8) or not. Is this expected behaviour? Is there a handy workaround so I can default the version to a different one? Thanks! Sean |
|
#2
|
|||
|
|||
|
http://www.cpearson.com/excel/versions.htm
Technically version 8 is '97. You could try version 9 to see if it changes. |
|
#3
|
|||
|
|||
|
Hey thanks for that IAmALlama -
Well the text of setVersion looks like: function setVersion($version) { if ($version == 8) { // only accept version 8 $version = 0x0600; $this->_BIFF_version = $version; // change BIFFwriter limit for CONTINUE records $this->_limit = 8228; $this->_tmp_format->_BIFF_version = $version; $this->_url_format->_BIFF_version = $version; $this->_parser->_BIFF_version = $version; $total_worksheets = count($this->_worksheets); // change version for all worksheets too for ($i = 0; $i < $total_worksheets; $i++) { $this->_worksheets[$i]->_BIFF_version = $version; } $total_formats = count($this->_formats); // change version for all formats too for ($i = 0; $i < $total_formats; $i++) { $this->_formats[$i]->_BIFF_version = $version; } } } The only version acceptable to this function is 8. All other versions fail silently. I'll go through the page you sent me and see if I can figure out at the bit-level what the code is trying to do and what it is trying to create within the BIFF for the XLS. I'll post back here if I get a result, or if anyone else has a clue, please post it up! Thanks, Sean |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PEAR Packages > Spreadsheet_Excel_Writer setVersion - does nothing for me... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|