Ugo Lfe
Ugo Lfe

Reputation: 767

Copy sheet containing pivot tables and graphs with Phpexcel

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

Answers (1)

Mark Baker
Mark Baker

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

Related Questions