/**
  *
  * @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');
 }
 static function fillData($objPHPExcel)
 {
     // no time limit for this script
     set_time_limit(0);
     $time_start = microtime(true);
     // remove first default sheet
     $objPHPExcel->removeSheetByIndex(0);
     // get wards
     $wards = WardCRUD::getWardsArray();
     foreach ($wards as $ward) {
         ExcelExport::newSheet($objPHPExcel);
         $wardName = $ward->name . " (" . $ward->getTypOddzialu() . ")";
         ExcelExport::printTitle($objPHPExcel, $wardName);
         $data = ExcelExportPunction::getData($ward->id, $ward->getTypOddzialu());
         $cols = PatientRaport::getColumns($ward->getTypOddzialu());
         ExcelExportPunction::printHeaders($objPHPExcel, $cols);
         ExcelExportPunction::printData($objPHPExcel, $data, $ward->getTypOddzialu());
         ExcelExport::styleActiveSheet($objPHPExcel);
     }
     ExcelExportPunction::fillSummary($objPHPExcel);
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(0, 100, "summary " . ($time_start - microtime(true)) . " s");
 }
 /**
  * @param unknown $objPHPExcel        	
  * @param unknown $title        	
  */
 static function printTitle($objPHPExcel, $title)
 {
     $objPHPExcel->getActiveSheet()->setTitle(ExcelExport::clearName($title, array('ddzia')), true);
     $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(0, 1, $title);
 }