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

Bug #8733 *** ERROR IN SST ***
Submitted: 2006-09-19 09:35 UTC
From: zielony at gemius dot pl Assigned:
Status: Open Package: Spreadsheet_Excel_Writer (version 0.9.0)
PHP Version: Irrelevant OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2006-09-19 09:35 UTC] zielony at gemius dot pl (Marcin Zielen)
Description: ------------ Error in Shared Strings Table when using setVersion(8). Test script: --------------- function GenerateRandomString( $i ) { return md5( $i ); }; $workbook=new Spreadsheet_Excel_Writer_Workbook(""); $workbook->setVersion(8); $worksheet =& $workbook->addWorksheet('worksheet'); $worksheet->setInputEncoding('utf-8'); for( $i=1; $i<2000; $i++ ) { $worksheet->write($i, 0, $i ); $worksheet->write($i, 1, GenerateRandomString($i) ); }; $workbook->close();

Comments

 [2006-09-19 09:39 UTC] zielony at gemius dot pl
Cells below 126 are corrupt
 [2006-09-20 10:57 UTC] zielony at gemius dot pl
Possible temporary fix. Long strings (over 4000 chars) still crash the .xls, but who cares. Nobody writes 4000 chars strings to .xls. 1. Change in workbook.php in function _calculateSharedStringsSizes(): from: foreach (array_keys($this->_str_table) as $string) { to: foreach (array_keys($this->_str_table) as $string) { if( strlen( $string ) > $continue_limit ) { die( "Error: string $string too long" ); }; 2. Change in workbook.php in function _calculateSharedStringsSizes(): from: if ($space_remaining > $header_length) { to: //if ($space_remaining > $header_length) { if (false){ 3. Change in workbook.php in function 1. Change in workbook.php in function _calculateSharedStringsSizes(): from: //if ($space_remaining > $header_length) { if ($space_remaining > $header_length) { to: if (false){