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

Bug #4329 setBgColor not working with setNumFormat?
Submitted: 2005-05-11 20:37 UTC
From: pear at adub dot com Assigned: progi1984
Status: Bogus Package: Spreadsheet_Excel_Writer
PHP Version: 5.0.4 OS: fedora core 3
Roadmaps: (Not assigned)    
Subscription  


 [2005-05-11 20:37 UTC] pear at adub dot com
Description: ------------ setBgColor seems to create a problem for formatting the cell content. See below. Reproduce code: --------------- $total =& $workbook->addFormat(); $total->setNumFormat('#,##0.00 "€";-#,##0.00 "€"'); $total->setBgColor('Gray'); // take this line out and all OK $worksheet->writeFormula(31, 1, "=SUM(B27:B31)", $total); Expected result: ---------------- cell B32 should sum the cells above it, be formatted and have a gray background. Actual result: -------------- It seems OK until values are entered into the cells above at which point the bg goes black. The cell's content format (Format->Cells) can't be accessed from Excel when setBgColor is set, regardless of whether setNumFormat is set.

Comments

 [2007-04-14 18:37 UTC] ferro287 (Leonhard Moehring)
Change the example into $total->setFgColor('gray'); and everything works fine, the documentation of setBgColor mentions set most users really want setFgColor. I really can't see an open bug here, this should be closed.
 [2009-08-05 20:18 UTC] progi1984 (Franck Lefevre)
-Status: Open +Status: Bogus -Assigned To: +Assigned To: progi1984
Thank you for taking the time to write to us, but this is not a bug. The function makes its job :)