Default Style in Excel5

Topics: Developer Forum, User Forum
Apr 30, 2008 at 12:10 PM
Edited Apr 30, 2008 at 12:10 PM
Hi,

I tried to set the default style for my Worksheet, which works fine with PHPExcelWriterExcel2007, but PHPExcelWriterExcel5 doesn't seem to like it.
It works only, when the style in a cell is modified.

E.g. try this code:

<?php
$objPHPExcel = new PHPExcel();
$objPHPExcel->setActiveSheetIndex(0);
$objPHPExcel->getActiveSheet()->getDefaultStyle()->getFont()->setName('Arial');
$objPHPExcel->getActiveSheet()->getDefaultStyle()->getFont()->setSize(20);

$objPHPExcel->getActiveSheet()->setCellValue('A1', 'Test');
$objPHPExcel->getActiveSheet()->setCellValue('A2', 'Test');

// set useless style to get default formatting
$objPHPExcel->getActiveSheet()->getStyle('A2')->getFont()->setBold(false);

$objPHPExcel->getActiveSheet()->setTitle('Simple');
?>

With Excel2007 A1 and A2 are in Arial with size 20. In Excel5 only A2 is Arial (20), A1 seems to be the default Excel style, which is Calibri (11).
Is this an issue of the PHPExcelWriterExcel5, or my Office 2007? I can't test it by opening the file in Office 2003 at the moment...

Edit: I'm using PHPExcel 1.6.1.
Coordinator
Apr 30, 2008 at 1:14 PM
Sounds like a small bug...
Coordinator
Apr 30, 2008 at 1:15 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.