question

Gabriel illescas Cavazos avatar image
0 Likes"
Gabriel illescas Cavazos asked Julie Weller commented

How can I export some tables to excel with tirggers commands?

export data
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Matt Long avatar image
2 Likes"
Matt Long answered Julie Weller commented

There are three ways you could do this:

1) There's an exporttable() command that allows you to export a node table (a Global Table or Label Table) to a CSV file. That CSV file can then be opened by Excel.

2) The second option is to use the excelmultitableexport() command. This does the same thing as pressing the Export Tables button on the Export tab of the Excel Interface. All tables that are checked will be exported when using this command. You can write some code to turn the tables on or off if you just need to export a subset of tables. Here's an example:

treenode excelAuto = model().find("Tools/ExcelAuto");
treenode exportTable = getvarnode(excelAuto, "exporttable");
exportTable.subnodes[1].find("Checked").value = 0; //Uncheck the first table
exportTable.subnodes[2].find("Checked").value = 1; //Check the second table
excelmultitableexport(); //Export the tables

3) The final option is to write a completely custom exporter. You can view a sample of this by going to the Custom tab of the Excel Interface and then under the Custom Export section, selecting the pick option Example Custom Export. Then view the code.


exporttables.png (39.5 KiB)
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

karthik avatar image karthik commented ·

Hi @Matt Long, I'm using the second solution of yours i.e., excelemultitableexport() in custom code in process flow.

1686510093816.png

1686509246422.png

I'm getting excel file with global table data as per your solution if I'm running the model in normal way.

But if I'm running the model the model in experimenter mode the model is not fetching any data of Table to dedicated/allocated excel file.

Please let me know what to do when I'm running experimenter.

0 Likes 0 ·
1686509246422.png (23.0 KiB)
Julie Weller avatar image Julie Weller karthik commented ·
Hi @karthik! This question would be better if asked as a new question with a link to the old post as per our community guidelines instead of posting on a 5 year old post. Thanks!
0 Likes 0 ·