How to Export a Pivot Table Using IdeaScript?

4 posts / 0 new
Last post
jsandoval
Offline
Joined: 03/01/2021 - 10:48
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's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

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
Offline
Joined: 03/01/2021 - 10:48

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?

Images: 
Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

First export the pivot table to IDEA and then export the new IDEA pivot database to Excel.