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

Bug #2261 Excel 2002 crashes when use write() with @ as first value of the text
Submitted: 2004-08-31 17:08 UTC
From: b-egner at t-online dot de Assigned: progi1984
Status: Closed Package: Spreadsheet_Excel_Writer
PHP Version: Irrelevant OS: Debian Woody
Roadmaps: (Not assigned)    
Subscription  


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 30 + 49 = ?

 
 [2004-08-31 17:08 UTC] b-egner at t-online dot de
Description: ------------ Excel 2002 crashes when using worksheet::write() with @ as first value of the text Example: $worksheet->write("@test"); Result: Excel 2002 (XP) crashes if you open an exported file... Reproduce code: --------------- $workbook = new Spreadsheet_Excel_Writer(); $workbook->send("test.xls"); $worksheet =& $workbook->addWorksheet("Mytitle"); $worksheet->write(0, 0, "@test"); // <-- Here's the "@" $workbook->close(); Expected result: ---------------- - test.xls exported - Opening with Excel 2002 shows in Column 0, 0 the value "@test" Actual result: -------------- - test.xls exported - Opening with Excel 2002 will crash Excel

Comments

 [2006-01-12 16:15 UTC] anicoll at dundeecity dot gov dot uk
I have similar problem. Using MS Excel 2000 with Verion 2.1 (I Think). Doesnt crash but passes what seems to be an error from the package through when I try to write a text string '@'. The value comes through to the spreadsheet as "Syntax error: , lookahead: , current char: 0" (my double quotes).
 [2006-01-12 16:32 UTC] anicoll at dundeecity dot gov dot uk
Solved my problem by specifically calling the writeString() method rather than the generic write() method. The write() (I Think) matches anything beginning with an '@' to a Formula and proceeds to use the writeFormula() method behind the scenes. I dont know if this helps with the problem causing a crash.
 [2009-07-31 13:14 UTC] progi1984 (Franck Lefevre)
Hello, I repoduce this bug on Centos 5.3 with PEAR Version: 1.8.1, PHP Version: 5.2.10, Zend Engine Version: 2.2.0. After some searchs, when you use "$worksheet->write("@test");", the @test is defined as a formula. I study the Spreadsheet_Excel_Writer in perl (this php package come from there). Link : http://cpansearch.perl.org/src/JMCNAMARA/Spreadsheet-WriteExcel-2.25/lib/Spreadsheet/WriteExcel/Worksheet.pm And in last version, the regex /^@/ detected as a formula doesn't exist. I search in Excel File Fomat documentation and the @ in start of content of a cell has no link with formula. So the test of the arobase at the start of the content of the cell for defining it as a formula is totally unuseful. For removing it : Open in your pear directory the file Spreadsheet\Excel\Writer\Worksheet.php and remove the 1157 to 1159. These lines in the method write: ------------ } elseif (preg_match("/^@/", $token)) { // Match formula return $this->writeFormula($row, $col, $token, $format); ------------
 [2009-08-05 13:59 UTC] progi1984 (Franck Lefevre)
The following patch has been added/updated: Patch Name: Bug2261 Revision: 1249462741 URL: http://pear.php.net/bugs/patch-display.php?bug=2261&patch=Bug2261&revision=1249462741&display=1
 [2009-08-05 14:23 UTC] progi1984 (Franck Lefevre)
The following patch has been added/updated: Patch Name: Bug2261 Revision: 1249464215 URL: http://pear.php.net/bugs/patch-display.php?bug=2261&patch=Bug2261&revision=1249464215&display=1
 [2009-08-05 15:55 UTC] progi1984 (Franck Lefevre)
-Assigned To: +Assigned To: progi1984
 [2009-08-08 13:02 UTC] cweiske (Christian Weiske)
-Status: Assigned +Status: Closed
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.