Bug 56020

Summary: [Patch] Patch for creating PivotTables
Product: POI Reporter: Sofia Larsson <sofia.larsson>
Component: XSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal CC: sofia.larsson
Priority: P2 Keywords: PatchAvailable
Version: 3.10-dev   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Patch for creating PivotTables
Patch for creating PivotTables
Patch for creating PivotTables
Quick guide of how to create a Pivot Table
Patch for creating PivotTables
updated patch for creating pivottables

Description Sofia Larsson 2014-01-16 15:11:19 UTC
Created attachment 31216 [details]
Patch for creating PivotTables

Patch which makes it possible to create pivot tables.

Default configurations are the same as when creating a default Pivot Table in Excel. 

Known future work:
*It's currently not possible to set any specific value to a filter on a column. 

An example of how to create a Pivot Table is presented in /src/examples/src/org/apache/poi/xssf/usermodel/examples/CreatePivotTable.java
Comment 1 Nick Burch 2014-01-16 15:39:16 UTC
Any chance you could write up a little bit of documentation for this, to go with the example in the patch, to help people learn about it and get started?
Comment 2 Sofia Larsson 2014-01-16 15:56:46 UTC
Absolutely!
I'll get back to you as soon as possible.
Comment 3 Sofia Larsson 2014-01-17 10:09:13 UTC
Created attachment 31222 [details]
Patch for creating PivotTables

I realized I had not merged all the latest changes to the patch, so here comes a new one. I'm working on the documentation and hope to get back to you with it soon!
Comment 4 Sofia Larsson 2014-01-17 16:44:52 UTC
Created attachment 31223 [details]
Patch for creating PivotTables
Comment 5 Sofia Larsson 2014-01-17 16:46:01 UTC
Created attachment 31224 [details]
Quick guide of how to create a Pivot Table
Comment 6 iamfuric 2014-01-27 12:21:09 UTC
Can you please point me to the branch/tag that contains pivot table API ?
I can't see it in the 3.10_beta2 release

Thanks
Alexander
Comment 7 Dominik Stadler 2014-02-01 21:02:40 UTC
I tried to apply the patch, but it does not apply cleanly neither with the "patch" commandline tool nor in Eclipse, both tools state that the patch is broken. Can you try to recreate the patch once more?
Comment 8 Sofia Larsson 2014-02-03 16:43:44 UTC
Created attachment 31281 [details]
Patch for creating PivotTables
Comment 9 Sofia Larsson 2014-02-03 16:44:54 UTC
It seems the tool I used in Windows corrupted the patch. This should apply cleanly!

(In reply to Dominik Stadler from comment #7)
> I tried to apply the patch, but it does not apply cleanly neither with the
> "patch" commandline tool nor in Eclipse, both tools state that the patch is
> broken. Can you try to recreate the patch once more?
Comment 10 Dominic 2014-04-14 17:28:53 UTC
Is there a target release for incorporting this path?
Comment 11 Nick Burch 2014-04-14 22:08:51 UTC
Given the past problems with the patch, it would be great if someone could try to apply it to a recent SVN checkout. Then, report back if it applies cleanly, if it fixes the problems, if it has sufficient unit test coverage etc. That'll greatly speed up the review + applying of it!
Comment 12 Martin Andersson 2014-04-18 21:50:47 UTC
Created attachment 31543 [details]
updated patch for creating pivottables

I took the liberty to update this patch.

Now it applies cleanly to latest trunk. I only removed diamond operators (Java 7) and fixed import statement problems.

All tests run. The provided example creates a pivot table that opens in Excel 2010 without any problems.
Comment 13 Martin Andersson 2014-07-25 09:38:37 UTC
Do you think this patch needs more testing or could it make it to 3.11 beta 1?
Comment 14 Nick Burch 2014-07-30 15:45:43 UTC
Thanks for this, patch applied (with some changes) in r1614684

It would be good to add some more getters to these new XSSF Pivot Table classes, for common things you might want to check, to avoid you having to dive down into the low level CT classes for that. If you / someone else are able to do that, with associated tests, please open a new enhancement ticket and upload the patch!