duanjiaonie6097 2017-10-11 14:57
浏览 313
已采纳

使用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!

  • 写回答

1条回答 默认 最新

  • doulu6160 2017-10-11 15:17
    关注

    PHPExcel doesn't support pivot tables.

    You'll have to use COM (with MS Excel itself) or Ilia Alshanetsky's Excel extension (with libXL).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么