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

Bug #16634 Cannot reassign a color to a cell
Submitted: 2009-09-23 04:48 UTC
From: frameone Assigned:
Status: Open Package: Spreadsheet_Excel_Writer (version 0.9.1)
PHP Version: 5.3.0 OS: Windows XP
Roadmaps: (Not assigned)    
Subscription  


 [2009-09-23 04:48 UTC] frameone (frame one)
Description: ------------ If you try to reassign a color to a reused Format-Objekt, the color will not applied to the cell. Of course, you can create a new Format-object for each cell, but this will result in a fatal memory leak in a bigger document! Test script: --------------- require_once 'Spreadsheet/Excel/Writer.php'; $workbook = new Spreadsheet_Excel_Writer(); $worksheet = &$workbook->addWorksheet('SetColor'); // which guy has put this into a loop? o.O $format = $workbook->addFormat(); for ($inc =0; $inc<64; $inc++) { // Sets the color of a cell's content $format->setColor($inc); $worksheet->write($inc, 0, 'Color (index '.$inc.')', $format); } $workbook->send('setColor.xls'); $workbook->close();

Comments