How to export in phpexcel click Export. The "Open save" dialog box is displayed. select the save path and save it. when you export in phpexcel, & nbsp; a file in excel can be generated directly upon a call and cannot be saved locally, how can I click Export to bring up the save dialog box and select the save path to save it? examples or ideas! & Nbsp; how to export in phpexcel click Export to bring up the open Save dialog box and select save path to save
When you export data using phpexcel, you can directly generate an excel file and cannot save it locally. how can you click Export to bring up the save dialog box and select the save path to save it, practical examples or ideas!
Export php in PhpExcel
Share:
------ Solution --------------------
The file is generated on the server. If JavaScript points to the generated excel file that cannot be opened by the browser, will the file be downloaded?
I have never tried it.
------ Solution --------------------
Save ()
Changed:
Header ("Content-Type: application/force-download ");
Header ("Content-Type: application/octet-stream ");
Header ("Content-Type: application/download ");
Header ('content-Disposition: inline; filename = "'. $ FileName .'"');
Header ("Content-Transfer-Encoding: binary ");
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: must-revalidate, post-check = 0, pre-check = 0 ");
Header ("Pragma: no-cache ");
$ ObjWriter-> save ('php: // output ');
------ Solution --------------------
// Sheet name
$ ObjPHPExcel-> getActiveSheet ()-> setTitle ('performance appraisal Statistics ');
// Set active sheet index to the first sheet, so Excel opens this as the first sheet
$ ObjPHPExcel-> setActiveSheetIndex (0 );
// Redirect output to a clients web browser (Excel5) notification download
$ Fn = "gxtj-policyear-policjd.xls ";
Header ('content-Type: application/vnd. ms-excel; charset = utf-8 ');
Header ("Content-Disposition: attachment; filename = $ fn ");
Header ('cache-Control: max-age = 0 ');
$ ObjWriter = PHPExcel_IOFactory: createWriter ($ objPHPExcel, 'excel5 ');
$ ObjWriter-> save ('php: // output ');
Exit;
Statement: This article is Liu Xing (http://deepfuture.iteye.com/) original, if reprint please indicate the source
Can this problem be solved?
------ Solution --------------------