Creating Pivot Tables

232 views
Skip to first unread message

Alex Rothenberg

unread,
Nov 2, 2012, 11:03:16 AM11/2/12
to ax...@googlegroups.com
Hi,

I have been buildling xlsx files by hand and its a real pain so this gem looks fantastic!

I'm wondering if there's any support for creating pivot tables? It seems to involve creating a sheet and also several other files (here's what I see from unzipping a .xlsx)

    xl/pivotCache/_rels/pivotCacheDefinition1.xml.rels
    xl/pivotCache/pivotCacheDefinition1.xml
    xl/pivotCache/pivotCacheRecords1.xml
    xl/pivotTables/_rels/pivotTable1.xml.rels
    xl/pivotTables/pivotTable1.xml

As a hacky fallback would it be possible for me to inject static copies of these files into what axlsx outputs?

Thanks
Alex

randym

unread,
Nov 2, 2012, 10:10:25 PM11/2/12
to ax...@googlegroups.com
Hi Alex, 

Sorry to say that pivot tables are the last BIG chunk of the spec that has not been implemented in axlsx yet.

Adding in the xml to your package and zipping it up is not going to work as the workbook and worksheet require a set of relationships and some other goo to make it all work. 

Any chance you'd like to tackle this? Axlsx welcomes all contributors!

randym

Alex Rothenberg

unread,
Nov 8, 2012, 4:17:13 PM11/8/12
to ax...@googlegroups.com
Do you a link to some documentation for various pivot table files?  If I could understand what its supposed to generate then (maybe) I could take a stab at it :)

--alex

randym

unread,
Nov 8, 2012, 11:56:20 PM11/8/12
to ax...@googlegroups.com
Hi Alex

There certainly is documentation (maybe too much!)

If you go to the repo downloads section, I have uploaded the ECMA-376 specification. You want Part 1.


The relevant parts are mostly in section 18.10.

You can fork/clone the repo and see how the basic structure of the gem is put together. For pivot tables, we would make another directory for all the classes required.

Have a look at at it, and please dont be shy if you have any questions. I am in JST but you can usually find me lurking around in IRC.
#axlsx

Warmest regards, 

Randy
Reply all
Reply to author
Forward
0 new messages