Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.9.4

Bug #2010 SetVersion (8) BIFF8 crashes Excel X
Submitted: 2004-07-28 23:53 UTC
From: emilio at dorial dot com Assigned: cschmitz
Status: Closed Package: Spreadsheet_Excel_Writer
PHP Version: 4.3.2 OS: Mac OS X
Roadmaps: (Not assigned)    
Subscription  


 [2004-07-28 23:53 UTC] emilio at dorial dot com
Description: ------------ MS Excel X SR1 (For Mac OS X) crashes when trying to open a file generated with setVersion(8). Both with long and short text fields.

Comments

 [2004-07-29 02:59 UTC] emilio at dorial dot com
This also affects Windows versions of Excel. Excel crashes when the file is in BIFF8 format and $worksheet->repeatRows(0) is present. Removing the method repeatRows from the application works as expected.
 [2004-09-09 21:50 UTC] lukasl at rogers dot com
I can confirm that $worksheet->repeatRows(0) crashes Excel 2003 SP1 on Windows XP.
 [2006-02-14 11:26 UTC] heck at ondics dot de
I changed in BIFFwriter.php the variable BIFFversion from 0x0500 to 0x0600 and all is perfect. No deleting from functions!!!
 [2006-05-29 09:15 UTC] ronaldcanete at gmail dot com (Ronald)
setVersion(8) together with $sheet->setInputEncoding('UTF-8') crashes excel 2003 when writing >175 rows, 19 cols with some korean characters in each row.
 [2006-06-14 21:12 UTC] schotte at mayflower dot de (Björn Schotte)
setVersion(8) also crashed here with setInputEncoding('iso-8859-5'); after about 100 rows - seems that only iso-8859-1 or no setInputEncoding() is working.
 [2006-10-11 07:45 UTC] micbox at freenet dot am (Mikayel Sukiasyan)
I have experienced the same crash problem while trying to generate Excel files with setVersion(8) and repeating a header row.
 [2006-10-18 10:41 UTC] pear at oliwel dot de (Oliver)
Can confirm this too - PHP 4.4 with v0.9.1. Document is Version 8 with UTF8 encoding. 32 Cols each row, crashes after 38 Rows. Oliver
 [2006-11-18 00:32 UTC] juha at kinesissurvey dot com (Juha Vehnia)
PHP Version 4.3.10 on SuSe Linux 9 with Excel Writer 0.9.1 crashes Excel 2003 on Windows XP. I have setVersion(8) and set encoding to UTF-8.
 [2006-12-20 17:39 UTC] cyberon at poczta dot onet dot pl (marger)
PHP 5 apache 2, excel crashes after setVersion(8) in php script :(
 [2007-01-09 15:23 UTC] marcofw at web dot de (Marco)
Hi, got problems with 0.9.1, setVersion(8) and setInputEncoding('UTF-8'). The data is stored in utf8 in MySQL after an reproducable count of rows it leads to an error and the following data is corrupt. Any news on this issue? Regards, Marco
 [2007-03-08 09:42 UTC] joey
Here is a list of bugs which seem to be duplicates of this one, some of them providing fix code, some of them closed: 1344, 1572, 2159, 8733, 9126, 9516. And this is some code to reproduce the problem: $workbook = new Spreadsheet_Excel_Writer(); $workbook->setVersion(8); $worksheet =& $workbook->addWorksheet('My first worksheet'); $worksheet->setInputEncoding('utf-8'); $data = array(); for ($i=0; $i<500; $i++) { $data[] = array($i.'hellö thëre', $i.'this', $i.'is', $i.'à', $i.'test'); } for ($i=0; $i<count($data); $i++) { for($j=0; $j<count($data[$i]); $j++) { $worksheet->write($i, $j, $data[$i][$j]); } } $workbook->send('test.xls'); $workbook->close(); It breaks with any encoding other than iso-8859-1. Omitting setVersion(8) results in a non-broken file, but in wrongly encoded non-ascii characters. I hope this problem can be solved soon, as setting the encoding is crucial for the Excel writer!
 [2007-04-09 20:37 UTC] cschmitz (Carsten Schmitz)
I agree. This problem should be top priority. Any patch or help until next release would be appreciated very much!
 [2007-09-21 07:54 UTC] jsebrech (Joeri Sebrechts)
There's a fork of the excel writer library that has added v8 / unicode support. Perhaps this could be useful: http://pizzaseo.com/php-excel-creator-class
 [2007-09-21 09:08 UTC] jsebrech (Joeri Sebrechts)
Never mind my last comment. That fork did not fix the issue. What did fix the issue was the code mentioned in Michael Fapso's post on http://pear.php.net/bugs/bug.php?id=1572 After applying that code I could export UTF-8 BIFF8 files of any size without issues.
 [2007-11-14 16:38 UTC] robny (Rob Newyork)
I can confirm this bug w/ IE7 and Excel 2003 SP2. I, personally, really need a fix for this so if anyone knows of one (using setVersion(8) with repeatRows()), please email me or post here. I require version(8) for long strings > 255 chars and for mergeCells() -- although mergeCells() seems to work without setVersion(8).
 [2007-11-16 13:05 UTC] spylee (Sophie Lee)
Excel 2002, Windows XP, PHP5, I've tried the suggestion from heck (changing BIFFversion 0x0500 to 0x0600) and Fapso's fix http://pear.php.net/bugs/bug.php?id=1572. No repeat rows, but exporting a large file with lots of formatting. Everything works fine until I put any command that has to do with print layout -- including print layout seems to crash excel.
 [2009-08-03 16:26 UTC] progi1984 (Franck Lefevre)
Version : PHP 5.2.10 Version : Centos 5.3 I confirme the use of the next patch : http://pear.php.net/bugs/bug.php?id=1572#1149063438 That adds supports of Unicode for BIFF8 files.
 [2009-11-29 06:39 UTC] cschmitz (Carsten Schmitz)
-Status: Verified +Status: Closed -Assigned To: +Assigned To: cschmitz
This problem should be fixed in release 0.9.2. Please check and re-open if necessary.
 [2010-02-16 21:45 UTC] ziquet (ziq ziq)
It's me or the problem remains unresolved? I use v9.2 with repeatRows(0) and setVersion(8) (for cells > 255 charaters) and Excel crash. I tested every fix mentioned but the problem still exists. So I must choose between being able to write lots of text in a cell (>255) or repeating the first line when printing (repeatRows()). If anyone has found a way to use these 2 features ...
 [2011-04-21 14:47 UTC] iparker (Timo Hähne)
I use the version 0.92 and I still have the problem that excel (v 10) crashes when I set the following parameter: $this->workbook->setVersion(8); $this->worksheet->setInputEncoding('utf-8'); With version 7 it works - but in this case I have problems with special chars like umlaute. Is there a solution for this problem?
 [2011-09-30 18:16 UTC] thiandoume (Moussa Thiandoume)
I use conv_utf8_iso8859_1 to convert $str in the function writeStringBIFF8 $str = iconv($this->_input_encoding, 'UTF-16LE', $this->conv_utf8_iso8859_1($str)); // $workBook->setVersion(8); $sheet->setInputEncoding('ISO-8859-1'); //here is the function function conv_utf8_iso8859_1($str_utf8) { $str_iso8859_1 = preg_replace("/([\xC2\xC3])([\x80-\xBF])/e", "chr(ord('\\1')<<6&0xC0|ord('\\2')&0x3F)", $str_utf8); return $str_iso8859_1; }