I'm using PHPSpreadsheet to generate an XLSX file. the code
$spreadsheet->setActiveSheetIndex(0);
$writer = new Xlsx($spreadsheet);
$full_filename = $path . $filename . '.xlsx';
$writer->save($full_filename);
When using the above code file only contains "Sheet1" and is blank but when I use
$spreadsheet->setActiveSheetIndex(0);
$writer = new Xls($spreadsheet);
$full_filename = $path . $filename . '.xls';
$writer->save($full_filename);
above code save the correct data with multiple sheets.
Saving XLSX used to work last week.
My server is:
- Ubuntu 18.04 LTS
- Mariadb 10
- PHP 7.2.10 using Yii2 framework
- using phpoffice/phpspreadsheet v. 1.3.1