Grouping by row

Topics: Developer Forum, User Forum
Jul 21, 2014 at 5:02 PM
Here's an example of what I would like to create via excel.

A 10
A 34
A 10
A (Total) 54
B 10
B 10
B 10
B (Total) 30
GrandTotal 84

Here's my code so far...

$objPHPExcel->getActiveSheet()->setCellValue('A1', "A");
$objPHPExcel->getActiveSheet()->setCellValue('A2', "A");
$objPHPExcel->getActiveSheet()->setCellValue('A3', "A");
$objPHPExcel->getActiveSheet()->setCellValue('A4', "B");
$objPHPExcel->getActiveSheet()->setCellValue('A5', "B");
$objPHPExcel->getActiveSheet()->setCellValue('A6', "B");

$objPHPExcel->getActiveSheet()->getRowDimension(1)->setOutlineLevel(1);
$objPHPExcel->getActiveSheet()->getRowDimension(2)->setOutlineLevel(1);
$objPHPExcel->getActiveSheet()->getRowDimension(3)->setOutlineLevel(1);

$objPHPExcel->getActiveSheet()->setCellValue('B1', "10");
$objPHPExcel->getActiveSheet()->setCellValue('B2', "34");
$objPHPExcel->getActiveSheet()->setCellValue('B3', "10");
$objPHPExcel->getActiveSheet()->setCellValue('B4', "10");
$objPHPExcel->getActiveSheet()->setCellValue('B5', "20");
$objPHPExcel->getActiveSheet()->setCellValue('B6', "10");

$objPHPExcel->getActiveSheet()->getRowDimension(4)->setOutlineLevel(2);
$objPHPExcel->getActiveSheet()->getRowDimension(5)->setOutlineLevel(2);
$objPHPExcel->getActiveSheet()->getRowDimension(6)->setOutlineLevel(2);

But instead it's outline the whole thing.