question

Steven Chen avatar image
0 Likes"
Steven Chen asked Jordan Johnson commented

excelexporttable() exports empty sheet for StatisticsCollector

Hello,

Because build-in Excel interface won't clear the sheet before exporting, I tried to use custom export script like this:

string filePath = "D:\\Data.xlsx";
excelopen(filePath);

string sheetName = "Sheet1";
Table table = Table("StatisticsCollector1");
exceldeletesheet(sheetName);
excelcreatesheet(sheetName);
excelsetsheet(sheetName);
excelexporttable(table, 1, 1, table.numRows, table.numCols);

excelsave();
excelclose(0);


But excelexporttable() on StatisticsCollector exports empty sheet.


By the way,

Use build-in Excel interface to export StatisticsCollector has encoding issue, which was fixed for GlobalTable in FlexSim 18.0.7, but not fixed for StatisticsCollector.

Table("StatisticsCollector1").cloneTo("GlobalTable1") throw exception.


Perhaps you could provide an option to let user choose the character encoding?

FlexSim 23.2.0
statistics collectorexcel export
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

·
Jordan Johnson avatar image
0 Likes"
Jordan Johnson answered Jordan Johnson commented

The excelexporttable() command does not currently support exporting Statistics Collectors or Calculated Tables. I will add a request to the dev list to improve this feature.

The encoding issue is on the dev list already. I will links this report to that issue.

I will also add a report that cloning a stats collector to a global table throws exceptions.

· 1
5 |100000

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

Jordan Johnson avatar image Jordan Johnson ♦♦ commented ·
For exporting Statistics Collectors to Excel, you can use the Excel interface. The API could still be improved, however.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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