border types problem

Feb 26, 2008 at 9:24 AM
Hi.

I have problems creating cell borders (dotted, dashed).
Always are render like THIN.

I'm testing with version 1.5.5 and 1.6.0. In format Excel5 and Excel2007

This is my code:

$objPHPExcel = new PHPExcel();
$objPHPExcel->setActiveSheetIndex(0);

$objPHPExcel->getActiveSheet()->duplicateStyleArray(
array(
'borders' => array(
'right' => array( 'style' => PHPExcelStyleBorder::BORDER_THIN ),
'left' => array( 'style' => PHPExcelStyleBorder::BORDER_THIN),
'top' => array('style' => BORDER_MEDIUMDASHDOTDOT),
'bottom' => array('style' => BORDER_MEDIUMDASHDOTDOT
)
)
),'D5:H10');

$objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->getTop()->applyFromArray(
array( 'style' => PHPExcelStyleBorder::BORDER_DASHDOT )
);

/*
// Save Excel 2007 file
$objWriter = new PHPExcelWriterExcel2007($objPHPExcel);
$objWriter->save( $_SERVER'DOCUMENT_ROOT'.'/temp/'.$nroCOA.'.xls' );
*/

// Save Excel 5 file
include 'PHPExcel/Writer/Excel5.php';
$objWriter = new PHPExcelWriterExcel5($objPHPExcel);
$objWriter->save( $_SERVER'DOCUMENT_ROOT'.'/temp/'.$nroCOA.'.xls' );

Any help ?

Thanks
Coordinator
Feb 26, 2008 at 11:41 AM
Is this in the Excel5 or Excel2007 version? In 2007 it should be OK. Excel5 version supports less features.