Hatch a cell

Jan 8, 2010 at 5:30 PM

Hi,

I can't find the mean to hatch a cell. I think that it is in a the class PHPExcel_Style_Fill but I can't find how do this.

Could you bring me please?

Thanks,

Alexis

Developer
Jan 14, 2010 at 6:18 AM
Edited Jan 14, 2010 at 6:18 AM
$excel = new PHPExcel();
$worksheet = $excel->getActiveSheet();

$worksheet->getStyle('A1:D5')
    ->applyFromArray(array(
        'fill' => array(
            'type' => PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRID,
            'startcolor' => array(
                'rgb' => 'FF0000',
            ),
            'endcolor' => array(
                'rgb' => '00FF00',
            )
        ),
    ));

$writer = PHPExcel_IOFactory::createWriter($excel, 'Excel2007');
$writer->save('write.xlsx');

Result:

Feb 4, 2010 at 9:52 AM

Thank you very much for this reply.

See you soon,

Alexis