PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » File Formats » Spreadsheet_Excel_Writer » Bug #4329

setBgColor not working with setNumFormat?

Details

Submitted2005-05-11 20:37 UTC
Frompear at adub dot com
Assignedprogi1984
StatusBogus
PackageSpreadsheet_Excel_Writer
PHP Version5.0.4
OSfedora core 3
Roadmaps(Not assigned)

Comments

[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.