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  
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes. If this is not your bug, you can add a comment by following this link. If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
2009-08-05 20:18 UTC
Package:
Bug Type:
Summary:
From: pear at adub dot com
New email:
PHP Version: Package Version: OS:

 

 [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 :)