application/controllers/Reporting.php
/**
	 * Output a spreadsheet report
	 *
	 * @param object $spreadsheet
	 */
Output a spreadsheet report
@param object $spreadsheet
Output a spreadsheet report @param object $spreadsheet
protected function outputSpreadsheetReport($spreadsheet, $report_type)
	{
		$filename = $this->createSpreadsheetFilename($report_type);
		header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
		header('Content-Disposition: attachment;filename="' . $filename . '"');
		header('Cache-Control: max-age=0');
		header('Cache-Control: max-age=1');
		header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); 
		header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); 
		header('Cache-Control: cache, must-revalidate'); 
		header('Pragma: public'); 
		$writer = IOFactory::createWriter($spreadsheet, 'Xlsx');
		$writer->save('php://output');
		exit;
	}
protected function outputSpreadsheetReport ( $ spreadsheet , $ report_type ) { $ filename = $ this -> createSpreadsheetFilename ( $ report_type ) ; header ( 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ) ; header ( 'Content-Disposition: attachment;filename="' . $ filename . '"' ) ; header ( 'Cache-Control: max-age=0' ) ; header ( 'Cache-Control: max-age=1' ) ; header ( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' ) ; header ( 'Last-Modified: ' . gmdate ( 'D, d M Y H:i:s' ) . ' GMT' ) ; header ( 'Cache-Control: cache, must-revalidate' ) ; header ( 'Pragma: public' ) ; $ writer = IOFactory :: createWriter ( $ spreadsheet , 'Xlsx' ) ; $ writer -> save ( 'php://output' ) ; exit ; }
Output a spreadsheet report
 @param object $spreadsheet
Output a spreadsheet report @param object $spreadsheet
// Redirect output to a client’s web browser (Xlsx) // If you're serving to IE 9, then the following may be needed // If you're serving to IE over SSL, then the following may be needed // Date in the past // always modified // HTTP/1.1 // HTTP/1.0