Description
This is:
- [ ] a bug report
- [V] 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?
Open the excel file (.xlsx) with dynamic tables and save the same file with dynamic tables
What is the current behavior?
The spreadsheet opens the excel file and saves the file without dynamic tables. Only plain text.
What are the steps to reproduce?
Use reader fuction to open the file
Force to readonly
Define a worksheet
Use writer function to save the file
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:
<?php
require __DIR__ . '/vendor/autoload.php';
// Create new Spreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
// add code that show the issue here...
$inputFileName = 'template-sample.xlsx';
$inputFileType = IOFactory::identify($inputFileName);
$reader = IOFactory::createReader($inputFileType);
$reader->setReadDataOnly(true);
$spreadsheet = $reader->load($inputFileName);
$spreadsheet->setActiveSheetIndex(1);
$writer = IOFactory::createWriter($spreadsheet, "Xlsx");
$writer->save("template-test.xlsx");
Which versions of PhpSpreadsheet and PHP are affected?
1.18.0