Default style : no borders

Dec 6, 2010 at 8:04 AM

Hello all,

I'm trying to apply a default style in my worksheet. Everything works except borders... Here is my code :

$worksheet->getDefaultStyle()->applyFromArray(array(
			'font'=>array(
				'name'      =>  'Arial',
				'size'      =>  12,
				'bold'      => true
			),
			'borders' => array(
				'allborders' => array('style' => PHPExcel_Style_Border::BORDER_DASHDOT, 'color' => array('rgb' => PHPExcel_Style_Color::COLOR_RED))
			),
			'alignment' => array(
				'wrap' => true
			)
		));

I get bold Arial fonts, wrapped texts, but all the borders remain thin and gray... Any idea of what I'm doing wrong ?

I tried saving in Excel5 and Excel2007 formats : same problem in both formats.

 

Thank you !

Coordinator
Dec 6, 2010 at 12:18 PM
Edited Dec 6, 2010 at 12:18 PM

This appears to be an error in PHPExcel: the code identifies left, right, top, bottom, diagonal and diagonaldirection when applying from array, but not allborders (even though this is documented behaviour).

Coordinator
Dec 6, 2010 at 12:20 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.