Re: Spreadsheet_Excel_Writer color problem
| From: | Matt Matijevich | Date: | Tue, 06 Apr 2004 16:39:42 +0000 |
| Subject: | Re: Spreadsheet_Excel_Writer color problem | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-11672@lists.php.net to get a copy of this message | ||
Certainly
Actually neither bgColor works, using 'green' or the integer, both set
the backround to black.
<?php
require_once 'Spreadsheet/Excel/Writer.php';
$workbook = new Spreadsheet_Excel_Writer();
$worksheet =& $workbook->addWorksheet();
$format_top_line =& $workbook->addFormat();
$format_top_line->setBold();
$format_top_line->setSize(14);
$format_top_line->setFontFamily('Garamond');
$format_top_line->setAlign('merge');
$format_top_line->setBgColor('green');
$worksheet->write(0, 0, 'test', $format_top_line);
$worksheet->write(0, 1, '', $format_top_line);
$worksheet->write(0, 2, '', $format_top_line);
$worksheet->write(0, 3, '', $format_top_line);
$worksheet->write(0, 4, '', $format_top_line);
$worksheet->write(0, 5, '', $format_top_line);
$worksheet->write(0, 6, '', $format_top_line);
$format_second_line =& $workbook->addFormat();
$format_second_line->setSize(12);
$format_second_line->setFontFamily('Garamond');
$format_second_line->setAlign('merge');
$format_second_line->setBgColor(10);
$worksheet->write(1, 0, 'test', $format_second_line);
$worksheet->write(1, 1, '', $format_second_line);
$worksheet->write(1, 2, '', $format_second_line);
$worksheet->write(1, 3, '', $format_second_line);
$worksheet->write(1, 4, '', $format_second_line);
$worksheet->write(1, 5, '', $format_second_line);
$worksheet->write(1, 6, '', $format_second_line);
$workbook->send('test.xls');
$workbook->close();
?>