You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [X] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)
What is the expected behavior?
On v. 1.9.0 Script run just fine and process time is < 2 sec.
Script load input.xlsx
and copy Sheet1 to COPY_SHEET
return Excel file with 2 worksheet output_1.9.0.xlsx
What is the current behavior?
Script takes very long time to process (>10 sec)
and output corrupted Excel file output_1.13.0.xlsx
<?phprequire_once (__DIR__ .'/../vendor/autoload.php');
usePhpOffice\PhpSpreadsheet\IOFactory;
$objReader = IOFactory::createReader('Xlsx');
$objPHPExcel = $objReader->load("input.xlsx");
$fileTitle = "TEST";
$sheet = $objPHPExcel->setActiveSheetIndex(0);
$copySheet = $sheet->copy();
$copySheet->setTitle("COPY_SHEET");
$objPHPExcel->addSheet($copySheet);
$sheet = $objPHPExcel->setActiveSheetIndex(0);
$memory_get_peak_usage = (memory_get_peak_usage(true) / 1024 / 1024);
$outFileName = $fileTitle."_".date("Y-m-d").".xlsx";
//////////////////////////////////////////////////////////// Redirect output to a client’s web browser (Excel2007)//////////////////////////////////////////////////////////header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header("Content-Disposition: attachment;filename=\"$outFileName\"");
header('Cache-Control: max-age=0');
// If you're serving to IE 9, then the following may be neededheader('Cache-Control: max-age=1');
// If you're serving to IE over SSL, then the following may be neededheader ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the pastheader ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modifiedheader ('Cache-Control: cache, must-revalidate'); // HTTP/1.1header ('Pragma: public'); // HTTP/1.0$objWriter = IOFactory::createWriter($objPHPExcel, 'Xlsx');
$objWriter->setPreCalculateFormulas(true);
$objWriter->save('php://output');
exit;
Which versions of PhpSpreadsheet and PHP are affected?
PhpSpreadsheet : 1.13.0
(Last known working version is 1.9.0)
PHP : 7.3.19
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.
This is:
What is the expected behavior?
On v. 1.9.0 Script run just fine and process time is < 2 sec.
Script load
input.xlsx
and copy Sheet1 to COPY_SHEET
return Excel file with 2 worksheet
output_1.9.0.xlsx
What is the current behavior?
Script takes very long time to process (>10 sec)
and output corrupted Excel file
output_1.13.0.xlsx
What are the steps to reproduce?
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
Which versions of PhpSpreadsheet and PHP are affected?
PhpSpreadsheet : 1.13.0
(Last known working version is 1.9.0)
PHP : 7.3.19
The text was updated successfully, but these errors were encountered: