Reputation: 318
can anyone find what's wrong with code ?
$workbook = new java("org.apache.poi.hssf.usermodel.HSSFWorkbook");
$cellStyle = $workbook->createCellStyle();
$palette = $this->workbook->getCustomPalette();
$palette->setColorAtIndex(0x40, 0, 102, 204);
$backGroundColor = $palette->getColor(0x40);
$cellStyle->setFillForegroundColor($backGroundColor->getIndex());
...
$cell->setCellStyle($cellStyle);
this code won't change background color
anyway
$cellStyle->setFillForegroundColor(0xc); // 0xc is index of blue
$cellStyle->setFillBackgroundColor(0xc);
doesn't work neither
Upvotes: 1
Views: 1269
Reputation: 318
setFillForegroundColor does nothing
$cellStyle->setFillPattern (1);
fills the cell with the foreground color.
Upvotes: 2