PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » File Formats » Spreadsheet_Excel_Writer » Bug #9516

Writer produces damaged XLS file

Details

Submitted2006-12-01 08:58 UTC
Fromjoeri_sebrechts at hotmail dot com
Assignedprogi1984
StatusClosed
PackageSpreadsheet_Excel_Writer
PHP Version4.4.2
OSWindows XP Pro
Roadmaps(Not assigned)

Comments

[2006-12-01 08:58 UTC] joeri_sebrechts at hotmail dot com

Description:
------------
When writing an XLS file using the code from the testxls.php file contained in the associated zip file, a damaged XLS file is produced. When trying to open this file in excel 2003 (build 11.5612.6360) it shows the following error:

Damage to the file was so extensive that repairs were not possible. Excel attempted to recover your formulas and values, but some data may have been lost or corrupted.

My php.ini file is included in the zip file as well.

Test script:
---------------
http://www.sharebigfile.com/file/29147/excelwriterproblem.zip.html

Expected result:
----------------
An undamaged XLS file containing the data from the JSON object in the testxls.php script.

Actual result:
--------------
A damaged XLS file.

[2006-12-05 06:53 UTC] tuupola at php dot net

What is contents of 'library/lib.pear.php'?

[2006-12-05 07:54 UTC] joeri_sebrechts at hotmail dot com

It's a library that uses ini_set to modify the include_path so that it can find the pear libraries. If pear is in your include_path by default that line shouldn't be necessary.

[2006-12-20 16:11 UTC] joeri_sebrechts at hotmail dot com

I have since troubleshooted this issue further. It seems to be caused by using the BIFF8 format. When I remove the setVersion(8) line things work fine (except that there is no UTF-8 support). I suspect this is related to bug 2010.

[2008-03-25 07:04 UTC] joeri_sebrechts at hotmail dot com

http://sebrechts.net/files/2008/excelwriterproblem.zip

As an aside, I got it working in UTF-8 mode, with version 8. See bug 2010.