/** * * @param PHPExcel $objPHPExcel */ private static function printFooter($objPHPExcel, $cols, $row) { $objPHPExcel->getActiveSheet()->getStyle('A' . $row . ':AA' . ($row + 1))->getFont()->setBold(true); // SUM $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(1, $row, "SUMA"); for ($i = 2; $i < count($cols); $i++) { $colLetter = chr(65 + $i); $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($i, $row, "=sum(" . $colLetter . "3" . ":" . $colLetter . ($row - 1) . ")"); } ExcelExport::cellColor($objPHPExcel, 'A' . $row . ':AA' . ($row + 1), 'DDDDDD'); }