SQL.injection
SQL.injection

Reputation: 2647

Clone pivot table with Apache POI 3.9?

Does anyone have any idea how to use Apache POI to read a pivot table from an existing excel file and then add it to a new file?

I already tried to clone an existing sheet, but unfortunately only the values were copied, hence it cannot be done this way...

Any ideas on what else I can try?

Upvotes: 1

Views: 2168

Answers (1)

akokskis
akokskis

Reputation: 1538

According to the limitations on the POI site, you can't create a new pivot table.

That being said, what I'd recommend (and the system that I work on does) is to use a template pivot table. Open that pivot table, clear out all rows except for the first row (row #0, as they are 0-based), then write your data into the appropriate columns and rows. Finally write out the spreadsheet as a new file and there you go, you've got a clone of your pivot table.

Upvotes: 3

Related Questions