PHPExcel icon indicating copy to clipboard operation
PHPExcel copied to clipboard

Pivot Table

Open sannyodictajr opened this issue 10 years ago • 13 comments

Hello Sir/Maam,

I've already researched and read several forum threads regarding reading existing excel template with pivot table already in it, then afterwards filling up of the source, the pivot table already disappeared (threads since 2009 up to 3rd quarter of 2013).

Was this issue already solved?

Thank you in advance.

sannyodictajr avatar Feb 04 '14 01:02 sannyodictajr

bump ~

sannyodictajr avatar Feb 05 '14 01:02 sannyodictajr

bumping this also +1

vlasvlasvlas avatar Jan 20 '15 18:01 vlasvlasvlas

+1

lusimeon avatar May 12 '15 16:05 lusimeon

+1

cons0l3 avatar Jun 15 '15 20:06 cons0l3

same problem here. Pivot functionality is gone after PHPExcel save.

lioman avatar Jan 12 '16 11:01 lioman

I am facing same problem. Pivot tables getting disappeared. Does anyone has solution on this?

ashokgharpankar avatar Jan 29 '16 06:01 ashokgharpankar

Pivot Tables are not supported.... and until somebody writes a solution that doesn't result in corrupt files in the majority of cases, then that will remain the case.

MarkBaker avatar Jan 29 '16 06:01 MarkBaker

@MarkBaker Thanks for quick reply, So, PHPEXcel library does not support pivot tables then I need to find other alternative, isn't it?

ashokgharpankar avatar Jan 29 '16 06:01 ashokgharpankar

Good luck finding an alternative, I only know of three ways to handle pivot tables in PHP:

  • PHP's COM extension (requires a COM enabled spreadsheet program such as MS Excel or OpenOffice Calc running on the server)
  • The Open Office alternative to COM (PUNO) (requires Open Office installed on the server with Java support enabled)
  • Ilia Alshanetsky's Excel extension now on github (requires commercial libXL component)

MarkBaker avatar Jan 29 '16 07:01 MarkBaker

And there is apache-poi wich handles pivot tables in a limited way.

XSSF has limited support for creating Pivot Tables, and very limited read/change support.

But you can create a Excelpivot template and write your Raw data to a given sheet and this works quit nice. And If you use SXSSF you can write large data sets into a file

lioman avatar Jan 29 '16 08:01 lioman

Sample base :

  • https://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/CreatePivotTable.java
  • https://dzone.com/articles/create-pivot-tables-pivot

Progi1984 avatar Jan 29 '16 15:01 Progi1984

In Perl you can extract the VB pivot code from an existing spreadsheet and inject that into a new one that you create. So by saving off the pivot ahead of time you can create a spreadsheet with a pivot table and data in one file from scratch.

I'm not sure if this would be a potential solution in the future with PHPExcel.

nadler avatar Aug 26 '16 21:08 nadler

same problem with me. Pivot table functionality from my template is gone after export.

csxcode avatar Jan 05 '18 20:01 csxcode