I have the following script
$this->load->library('excel');
$filename = FCPATH.'assets/template/monthly_report.xlsx';
$filetype = PHPExcel_IOFactory::identify($filename);
$objReader = PHPExcel_IOFactory::createReader($filetype);
$objReader->setIncludeCharts(TRUE);
$this->objExcel = $objReader->load($filename);
$this->objExcel->setActiveSheetIndex(0);
$sheet = $this->objExcel->getActiveSheet();
$sheet->setCellValue('A3', $process->process_name);
$last_num = 2; // row terakhir
$last_num_counter = 2; // row terakhir untuk counter
for($i = 4; $i <= $date_max + 3; $i++){
$cell = $this->translate_cell($i);
$sheet->setCellValue($cell.'2', date(($i - 3).'-M'));
}
foreach($schedules as $schedule){
}
$filename='Laporan Bulanan.xlsx';
header('Content-Type: application/vnd.ms-excel'); //mime type
header('Content-Disposition: attachment;filename="'.$filename.'"'); //tell browser what's the file name
header('Cache-Control: max-age=0'); //no cache
// PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);
$objWriter = PHPExcel_IOFactory::createWriter($this->objExcel, $filetype); //Excel2007
$objWriter->setIncludeCharts(TRUE);
$objWriter->save('php://output');
the script is loading an xlsx file as a template, the template itself contain a graph/chart. so, all I have to do is replace data in cells and then save it, without any touch to the chart stuff and then save it. but, it produce error in the begining of the generated xlsx
file, it said
<p>Severity: Warning</p>
<p>Message: PHPExcel_Reader_Excel2007_Chart::getAttribute(): Node no longer exists</p>
<p>Filename: Excel2007/Chart.php</p>
<p>Line Number: 40</p>
I have no idea about that error, please somebody save my day.