Skip to main content

How to Export a Pivot Table Using IdeaScript?

Hello,
I'm trying to export a pivot table but I don't know the code to do this. I already know how to export it by using the interface of IDEA, but I need to create a script to automate the process and users just have to look for the excel in the export folder. Does anyone know how to do it?

Brian Element Wed, 04/28/2021 - 07:43

When you are in the Pivot Table there is an option to generate the IDEAScript code for your pivot table.  Just select it and it will open in the IDEAScript editor.

jsandoval Wed, 04/28/2021 - 17:15

Hello Brian,
Thanks for your quick response.
What I am trying to do is to export a pivot table to an excel file. I know if I click on the icon circled in red, I can export it, but that doesn't generate IdeaScript Code. If it was a database, I would use a code like this:
Set db = Client.OpenDatabase("Database Name.IMD")
Set task = db.ExportDatabase
Since this is a pivot table instead of a database. What code should I use to export it?

mwiger Wed, 08/11/2021 - 10:01

In reply to by Brian Element

Hello Brian,
 
The pivot table that I created will not let me export to an IDEA database. I have multiple data fields.  I get the error that the pivot table can only contain one row, column and data field when exporting. 
 
Is there another way to export this pivot table via IDEAScript?
 
Thanks

Brian Element Sat, 08/14/2021 - 08:57

In reply to by mwiger

Hi mwiger,

Unfortunately the export to database only allows you to expert one row, one column and one data field.  The way to get around this is to create a new field and merge your fields together before creating the pivot table, this way you will be able to do the export.

mwiger Thu, 10/06/2022 - 14:47

In reply to by Brian Element

Hi Brian,
 
I currently have a pivot table that has 2 row fields.  I am able to send the pivot table to Excel but I am not able to see the code for the export.  Is there a way that I can find the code that exports the pivot table to Excel? 
 
Thanks

Brian Element Thu, 10/06/2022 - 19:41

In reply to by mwiger

Sorry, they didn't implement any code to do this, only to export to IDEA and you can't do an IDEA export with two rows, only one row.