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

Bug #5347 using writeNote() causes excel crash
Submitted: 2005-09-09 09:39 UTC
From: patrick dot douret at edf dot fr Assigned:
Status: Analyzed Package: Spreadsheet_Excel_Writer
PHP Version: 4.3.3 OS: Windows 2000 Professionnal
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


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 : 9 + 27 = ?

 
 [2005-09-09 09:39 UTC] patrick dot douret at edf dot fr
Description: ------------ I need to create an excel sheet in which I would like to add notes for some cells. So I am using the function writeNote. When opening the xls document, excel crashes. My version are: PHP 4.3.3 EXCEL 2000 SR1 (FRENCH) Spreadsheet_Excel_Writer-0.8 OLE-0.5 Test script: --------------- <?php require_once('php/v1_1/classes/Excel/pear/Worksheet.php'); require_once('php/v1_1/classes/Excel/pear/Workbook.php'); $fname = tempnam("./tmp", "laf.xls"); $workbook =& new Spreadsheet_Excel_Writer_Workbook($fname); $workbook->setVersion(8); //I need this for some reasons $worksheet =& $workbook->addworksheet('test'); $worksheet->writeString( 5, 1, "ceci n'est qu'un test totalement bidon", $fTxtCell_2); $worksheet->writeNote( 5, 1, "ceci n'est qu'un test de note totalement bidon"); $workbook->close(); ?> Expected result: ---------------- The created xls document should open correctly. The cell (5,1) should contain "ceci n'est qu'un test totalement bidon" and it's associated note should be "ceci n'est qu'un test de note totalement bidon". Actual result: -------------- I've got a lovely message box saying that memory cannot be read and excel will be closed

Comments

 [2006-03-23 05:59 UTC] ajones at ca dot umces dot edu (Adrian Jones)
Would like to add that I have the same problem, when using SetVersion(8) and the writeNote function, Excel 2003 crashes and says there are too many problems to fix. Once I remove the writeNote function it works perfectly.
 [2006-11-09 12:58 UTC] tomgu at hotmail dot com (Tom G.)
I have the same problem (using Spreadsheet_Excel_Writer 0.9.0). The problem only occurs when using excel format version 8 and the writeNote-method: $workbook = new Spreadsheet_Excel_Writer(); $workbook->setVersion(8); $worksheet =& $workbook->addWorksheet('myTitle'); $worksheet->setInputEncoding('utf-8'); //Not needed to provoke bug $worksheet->writeNote('myNote'); PHP 4.3.4 MS EXCEL XP (2003) SP2 Spreadsheet_Excel_Writer 0.9.0 OLE-0.5
 [2007-09-18 14:38 UTC] gwinkless (Geoff Winkless)
Some investigation reveals that notes in BIFF8 are implemented as drawing objects (textboxes, at a guess). http://chicago.sourceforge.net/devel/docs/escher/ eg if you get a hex editor and search for a note with a known string within a BIFF8 file, you find this in the data a few hundred bytes (in the example I'm looking at it's 267 bytes before but that might vary) before the text: 00 00 0F 00 04 F0 28 00 You can reference this back to the escher docs, and remembering it's all least-significant-byte ordered (so you swap the bytes for words) 0000 (ver) 000F (inst) F004 msofbtSpContainer - shape container 0028 object length there are several more within this, with the final entry before the text itself being F00D - an msofbtClientTextbox. While the escher docs don't exactly seem to fit with what I see, I'd suggest that anyone with enough time and inclination should start there, I'm afraid I don't have either :) :) :)
 [2007-09-18 15:05 UTC] gwinkless (Geoff Winkless)
additional info: jExcelAPI might be a useful place to start if you know any java. http://www.jdocs.com/jexcepapi/2.6/api-index.html?m=package&p=jxl.biff.drawing&render=classic
 [2009-08-05 20:22 UTC] progi1984 (Franck Lefevre)
-Status: Open +Status: Verified
With Microsoft Specification (http://msdn.microsoft.com/en-us/library/cc313154.aspx), page 148, Record Note. Two records NOTE exists : one for BIFF8 and one for BIFF7 and earlier. And that which is implemented here is for BIFF7 and earlier. So if you use "$workbook->setVersion(8);", Excel2000 crashes.
 [2009-08-12 12:49 UTC] progi1984 (Franck Lefevre)
-Status: Verified +Status: Analyzed