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

Request #16852 export more than 255 characters
Submitted: 2009-11-30 20:59 UTC
From: marine_nl_1976 Assigned: sanmai
Status: Closed Package: Spreadsheet_Excel_Writer (version 0.9.2)
PHP Version: 5.3.0 OS: Win XP
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 : 26 + 42 = ?

 
 [2009-11-30 20:59 UTC] marine_nl_1976 (Jeroen Goddijn)
Description: ------------ I need Spreadsheet_Excel_Writer to export more than 255 characters to Excel. CSV is not an option, because I need formatting as well (with backgroundcolors, formula's etcetera). If there is a hack/workaround for this, please let me now. But it has to work in WORKBOOK/WORKSHEET instead of CSV or other formats. setVersion(8) crashes Excel ( it restores some text, but Formatting is completely lost) Expected result: ---------------- full field value exported from MySQL Actual result: -------------- field value export breaks after 255 characters.

Comments

 [2011-01-18 00:20 UTC] ssanders (Scott Sanders)
I needed this too, so just comment out the following in ExcelWriter/Worksheet.php at around line 1496, like so: //if ($strlen > $this->_xls_strmax) { // LABEL must be < 255 chars // $str = substr($str, 0, $this->_xls_strmax); // $length = 0x0008 + $this->_xls_strmax; // $strlen = $this->_xls_strmax; // $str_error = -3; //}
 [2011-01-19 21:53 UTC] ssanders (Scott Sanders)
Sorry, the above kinda works but only if you open in say OpenOffice.org Calc. In ExcelWriter/Worksheet.php, there is this comment above line 1451: "* NOTE: there is an Excel 5 defined limit of 255 characters." So this writes as Excel 5 by default (!) -- but you can simply set the BIFF version to BIFF8, which has no char limit, like so: $workbook->setVersion(8); More info here: http://pear.php.net/manual/en/package.fileformats.spreadsheet-excel-writer.spreadsheet-excel-writer-workbook.setversion.php Note that the project also says, "BIFF8 format with Unicode support is also available now but still in early stage," but it works fine for me so far. :)
 [2011-12-14 11:00 UTC] ashwanisingh22 (Ashwani Singh)
$workbook->setVersion(8); this method work for me
 [2011-12-19 19:28 UTC] ssanders (Scott Sanders)
PHPExcel is an update of this package, exports infinite characters, and a lot more: http://www.phpexcel.net/
 [2017-05-25 02:28 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.
 [2020-07-13 03:22 UTC] sanmai (Alexey Kopytko)
-Status: Feedback +Status: Closed -Assigned To: +Assigned To: sanmai
Docs updated to match. Commit 2809d7d.