Bug #19278 [Com]: File was corrupted
| From: | koenigsegg | Date: | Thu, 23 Feb 2012 00:58:12 +0000 |
| Subject: | Bug #19278 [Com]: File was corrupted | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-8307@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=19278&edit=1
ID: 19278
Comment by: koenigsegg
Reported By: torbjorn at binarydesigns dot se
Summary: File was corrupted
Status: Open
Type: Bug
Package: Spreadsheet_Excel_Writer
Operating System: Windows7
Package Version: 0.9.3
PHP Version: 5.2.6
New Comment:
Harlequin76's solution worked for me as well, though downgrading OLE
from 1.0.0RC2 to 1.0.0RC1 sufficed for me. (Spreadsheet excel writer
v0.9.3, PHP 5.3.6)
Previous Comments:
------------------------------------------------------------------------
[2012-02-12 15:57:28] harlequin76
hello!
Had the same problem. Uninstalled Spreadsheet_Excel_Writer AND OLE and
than installed not the latest version of OLE (1.0.0RC2) but OLE 1.0.0RC1
- solved the problem for me...
have fun!
------------------------------------------------------------------------
[2012-02-07 11:33:29] aaaa
May be related to:
http://support.microsoft.com/kb/2411912
------------------------------------------------------------------------
[2012-02-06 15:05:38] arunravuri
it was not working in 0.9.2.
------------------------------------------------------------------------
[2012-02-06 15:04:08] doconnor
Hi Arun, are you suggesting this used to work (0.9.2); or is broken in
previous
versions as well?
------------------------------------------------------------------------
[2012-02-06 09:07:07] arunravuri
Description:
------------
I was created a excel file in windows 7 and when i opened the file . I
am getting "Excel found unreadable content. Do you want to recover the
content of this work book?
And file is opening in windows Xp/MAC.
Test script:
---------------
$excel = new Spreadsheet_Excel_Writer("Files/".$filename.".xls");
// add worksheet
$sheet =& $excel->addWorksheet();
// create format for header row
// bold, red with black lower border
$firstRow =& $excel->addFormat();
$firstRow->setBold();
$firstRow->setSize(12);
$firstRow->setColor('red');
$firstRow->setBottom(1);
$firstRow->setBottomColor('black');
// add data to worksheet
$rowCount=0;
foreach ($data as $row) {
foreach ($row as $key => $value) {
if($rowCount==0)
$sheet->write($rowCount, $key, $value,$firstRow);
else
$sheet->write($rowCount, $key, $value);
}
$rowCount++;
}
// save file to disk
$excel->close();
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=19278&edit=1