Ask questionsMiss Dynamic Tables
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)
Open the excel file (.xlsx) with dynamic tables and save the same file with dynamic tables
The spreadsheet opens the excel file and saves the file without dynamic tables. Only plain text.
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");
1.18.0
Answer
questions
MarkBaker
Correct... none of the Readers support dynamic tables like pivot tables. That is something we are currently investigating
Related questions