Trouble formatting excel spreadsheet
| From: | Louis Young | Date: | Wed, 19 Jan 2005 13:12:30 +0000 |
| Subject: | Trouble formatting excel spreadsheet | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-17016@lists.php.net to get a copy of this message | ||
Hi there
I'm trying to format an excel spreadsheet using Apache 2, PHP 5 and PEAR on Windows XP.
Here's the code:
$workbook=new Spreadsheet_Excel_Writer("test.xls");
// Add a new worksheet
$worksheet=& $workbook->addWorksheet("Electricity Transactions");
// add the color format to the workbook
$format_color=& $workbook->addFormat();
$format_color->setBgColor('green');
$format_color->setPattern(0);
$ReturnBalance=2;
$worksheet->write(2, 1, "Current Balance : R ".number_format($ReturnBalance, 2), $format_color);
$workbook->close();
But when I open the spreadsheet the background of the cell is white. What gives?
Cheers
Louis