[PEAR-BUG] Bug #20207 [Com]: Excel reports that the spreadsheet is damaged

[email protected] ("dcd")
Newsgroups php.pear.bugs
Message-ID <[email protected]>
Edit report at http://pear.php.net/bugs/bug.php?id=20207&edit=1

 ID:               20207
 Comment by:       dcd
 Reported By:      danny dot dorner at gmail dot com
 Summary:          Excel reports that the spreadsheet is damaged
 Status:           Open
 Type:             Bug
 Package:          Spreadsheet_Excel_Writer
 Operating System: Windows 7
 Package Version:  0.9.3
 PHP Version:      5.5.9
 New Comment:

Have you installed OLE-1.0.0RC2? -> Go back to RC1
It seems to be an error in OLER RC2.

I hope this will help


Previous Comments:
------------------------------------------------------------------------

[2014-02-26 18:11:15] jramsey_dc

Description:
------------
This happens after a given amount of data is put into the spreadsheet. 
The simplest example I can come up with is below: the letter "t" in the
first cell of a given row.  Once you populate the 237th row, you will
start getting the notice.  Excel will "fix" the file and open it up.  A
binary comparison of the two files shows that byte 25 is the only
difference.

===============================
unix-command: cmp test.xls fixed.xls -b
test.xls fixed.xls differ: byte 25, line 1 is  73 ;  76 >

Test script:
---------------
<?php
require_once("OLE.php");
require_once("Spreadsheet/Excel/Writer.php");
$fname='test.xls';
$workbook = new Spreadsheet_Excel_Writer($fname);
$worksheet=&$workbook->addWorksheet($name);
$maxRows=237;
for($rowNum=0; $rowNum<$maxRows; $rowNum++) {
	$worksheet->writeString($rowNum,0,'t');
}
$workbook->close();
?>

Expected result:
----------------
You should get an output file "test.xls".  This file should have the
letter 't' in column 'A' for 237 rows.  Opening the file should not show
any warnings.

Actual result:
--------------
The test script will output a file "test.xls".  Opening this file on a
Windows 7 machine in Microsoft Office (we tested 2003, 2003 SP3, and
2010) will show an error about the file being corrupt, provide recovery
options and instruct the user to save the file.

------------------------------------------------------------------------


-- 
Edit this bug report at http://pear.php.net/bugs/bug.php?id=20207&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.