Bug on setBorderStyle?

Topics: Developer Forum, Project Management Forum, User Forum
Sep 8, 2008 at 4:16 PM
Okay I think I found a bug in PHPExcels behavior.

When you mergeCells with:
    $objPHPExcel->getActiveSheet()->mergeCells('A5:A13');

and then apply borders with:
    $objPHPExcel->getActiveSheet()->getStyle('A5')->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
    $objPHPExcel->getActiveSheet()->getStyle('A5')->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
    $objPHPExcel->getActiveSheet()->getStyle('A5')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
    $objPHPExcel->getActiveSheet()->getStyle('A5')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);

the bottom won't have a border.

the fix for this is to apply a border with:
    $objPHPExcel->getActiveSheet()->getStyle('A13')->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);

i am using the Excel5 Writer and the stable release PHPExcel 1.6.3
Coordinator
Sep 8, 2008 at 6:10 PM
Not really a bug, more a side effect of merge cells... Keep in mind to apply styles to all cells in the merge cell and you should encounter no weirdness.
Developer
Sep 8, 2008 at 7:16 PM
Related discussion:
http://www.codeplex.com/PHPExcel/Thread/View.aspx?ThreadId=33536