Answer the question
In order to leave comments, you need to log in
PHPExcel Codeigniter not working?
There is a piece of code:
header ( "Expires: Mon, 1 Apr 1974 05:00:00 GMT" );
header ( "Last-Modified: " . gmdate("D,d M YH:i:s") . " GMT" );
header ( "Cache-Control: no-cache, must-revalidate" );
header ( "Pragma: no-cache" );
header ( "Content-type: application/vnd.ms-excel" );
header ( 'Content-Disposition: attachment; filename="fname.xls"' );
$objWriter = new PHPExcel_Writer_Excel5($objPHPExcel);
$objWriter->save('php://output');
echo 1;
Answer the question
In order to leave comments, you need to log in
I have added coding
header('Content-Type', 'text/vnd.ms-excel; charset=utf-8');
I have output like this:
$filename='invoice.xlsx';
header('Content-Type: application/vnd.openxmlformats-officedocument.excelprocessingml.document');
header('Content-Disposition: attachment;filename="'.$filename.'"');
header('Cache-Control: max-age=0'); //no cache
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save('php://output');
die();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question