tags:

views:

32

answers:

2
<?php
require_once 'Spreadsheet/Excel/Writer.php';

$workbook = new Spreadsheet_Excel_Writer();

$format6 =& $workbook->addFormat();
$format6->setBgColor('green');
$format6->setPattern(6);
$worksheet->write(1, 1, 'the bg', $format6);

$workbook->send('setBgColor.xls');
$workbook->close();
?> 

Can you please tell me the the pattern for "Grey" color.as it is 6 in case of green .

A: 

It may be hard to answer without knowing what 'Spreadsheet/Excel/Writer.php' contains.

Have you tried simply changing $format6->setBgColor('green'); to $format6->setBgColor('grey'); (or 'gray', the spelling is interchangeable)

Ergo Summary
A: 

15, 16, and 48 are all grays. See this page for a full list: http://www.mvps.org/dmcritchie/excel/colors.htm

Pass these values to setBgColor. setPattern changes between solid fill, dots, etc.

bemace