FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=4329&edit=1

ID: 4329
Updated by: progi1984@gmail.com
Reported By: pear at adub dot com
Summary: setBgColor not working with setNumFormat?
-Status: Open
+Status: Bogus
Type: Bug
Package: Spreadsheet_Excel_Writer
Operating System: fedora core 3
PHP Version: 5.0.4
-Assigned To:
+Assigned To: progi1984
Roadmap Versions:
New Comment:

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


Previous Comments:
------------------------------------------------------------------------

[2007-04-14 14:37:19] ferro287

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.

------------------------------------------------------------------------

[2005-05-11 16:37:22] 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.

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedAug 6, '09 at 7:40a
activeAug 6, '09 at 7:40a
posts1
users1
websitepear.php.net

1 user in discussion

Progi1984: 1 post

People

Translate

site design / logo © 2022 Grokbase