I'm using the PHPExcel to generate some sheets on my server. More or less it everything works fine, but, when I try to color some rows (every second row, so the list would be easily readable) I get funny thing: the row is colored ok, but only on cells that are not filled with data. The cells that are filled with data remain white.
Here's code I use
$ind = ($ind + 1) % 2;
if($ind == 1)
{
$style_header = array(
'fill' => array(
'type' => PHPExcel_Style_Fill::FILL_SOLID,
'color' => array('rgb'=>'CCC'),
),
'font' => array(
'bold' => true,
)
);
$sheet->getStyle($row)->applyFromArray( $style_header );
}
$sheet->getCellByColumnAndRow(0, $row)->setValue($item['qty']);
$sheet->getCellByColumnAndRow(1, $row)->setValueExplicit($item['name']);
$sheet->getCellByColumnAndRow(2, $row)->setValueExplicit($item['size']);
$sheet->getCellByColumnAndRow(3, $row)->setValueExplicit($item['color']);
What am I doing wrong?