Reputation: 767
I have to create an Excel file with a data sheet that will vary according to a database and a sheet containing multiple PivotTables that have their own PivotCharts. Having already my sheet containing my PivotTables and PivotCharts. I would just like to automate the action of "copy a sheet on another workbook".
First, I'm just trying to duplicate my file containing the sheet with the TCD and GCD.
that's my piece of code :
$objPHPExcel1 = PHPExcel_IOFactory::load("example.xlsx");
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel1, 'Excel2007');
$objWriter->save('example2.xlsx');
This will create the file "example2.xlsx" but he will be empty with a single sheet instead of two.
Thanks to your help!
Upvotes: 2
Views: 1834
Reputation: 212412
PHPExcel doesn't support pivot tables.
You'll have to use COM (with MS Excel itself) or Ilia Alshanetsky's Excel extension (with libXL).
Upvotes: 4