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

Bug #19321 Corrupt spreadsheet
Submitted: 2012-03-08 22:24 UTC
From: adrianbjones Assigned:
Status: Feedback Package: Spreadsheet_Excel_Writer (version 0.9.3)
PHP Version: 5.3.10 OS: Debian
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 : 49 - 49 = ?

 
 [2012-03-08 22:24 UTC] adrianbjones (Adrian Jones)
Description: ------------ When creating a spreadsheet with 0.9.3 I get the following errors: fseek() expects parameter 1 to be resource, string given in /usr/local/lib/php/Spreadsheet/Excel/Writer/Worksheet.php on line 688 fread() expects parameter 1 to be resource, string given in /usr/local/lib/php/Spreadsheet/Excel/Writer/Worksheet.php on line 694 Reverting to 0.9.2 fixes the problem.

Comments

 [2012-03-08 22:37 UTC] adrianbjones (Adrian Jones)
Sorry, I should have searched better. Looks like it is the issue with 0.9.3 and OLE-1.0.0RC2: http://pear.php.net/bugs/bug.php?id=19284 So either downgrade to 0.9.2 or OLE-1.0.0RC1
 [2012-03-09 03:30 UTC] adrianbjones (Adrian Jones)
Actually it turns out the Mac/Excel 2011 can read them from 0.9.2 and OLE-1.0.0RC2, but for larger(?) spreadsheets, Windows/Excel 2010 needs 0.9.2 and OLE-1.0.0RC1
 [2012-08-30 21:44 UTC] zeitpunkt (Manfred Anonymous)
The problem seems to be code in Worksheet.php line 649-657 closing the file. But the file is accessed later again in line 688. So you need the move the closing code to the end of the getData() method: function close($sheetnames) { ...... /* WN: HOTFIX: CODE DISABLED - FILE IS ACCESSED AGAIN AFTER IT IS WRITTEN if ( $this->_tmp_file != '' ) { if ( $this->_filehandle ) { fclose($this->_filehandle); $this->_filehandle = ''; } @unlink($this->_tmp_file); $this->_tmp_file = ''; $this->_using_tmpfile = true; } */ ..... function getData() { ....... // WN: HOTFIX: MOVED CODE FROM LINE 653 here if ( $this->_tmp_file != '' ) { if ( $this->_filehandle ) { fclose($this->_filehandle); $this->_filehandle = ''; } @unlink($this->_tmp_file); $this->_tmp_file = ''; $this->_using_tmpfile = true; } // No data to return return ''; } With the OLE RC2 Workaround from identit (http://pear.php.net/bugs/bug.php?id=19284#1344445946) applied it seems to be possible to use Spreadsheet_Excel_Writer 0.9.3 together with 1.0.0RC2 successfully
 [2014-10-24 23:42 UTC] rirobel_ing (rihab el abed)
I have a problem with Excel 2013 , in fact all the cells are not well formatted . the chart is stopped in a certain number of cells. Could someone help me please ?
 [2016-06-21 02:55 UTC] sanmai (Alexey Kopytko)
-Status: Open +Status: Feedback
Thank you for taking the time to report a problem with the package. Unfortunately you are not using a current version of the package -- the problem might already be fixed. Please download a new version from http://pear.php.net/packages.php If you are able to reproduce the bug with one of the latest versions, please change the package version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PEAR.
 [2016-06-21 04:34 UTC] sanmai (Alexey Kopytko)