We are currently running DS 1.5.
I got a request to test the capability to disable totals on Excel exports without removing them from a Crosstab. Approach taken: checking each row field for whether its total is displaying, hiding totals on all of those fields, exporting to Excel, and then reversing the first action using the code below (FYI, referenceString is a Global Script variable).
var Dimensions=DS_1.getDimensions(Axis.ROWS);
Dimensions.forEach(function(element, index) {
if (DS_1.getTotalsDisplay(element.name)==TotalsDisplay.SHOW)
{
referenceString=referenceString+element.name+"/";
DS_1.setTotalsDisplay(element.name, TotalsDisplay.HIDE); }
});
APPLICATION.export(ExportType.EXCEL_xlsx);
var Dimension_Array=referenceString.split("/");
Dimension_Array.forEach(function(element, index) {
DS_1.setTotalsDisplay(element, TotalsDisplay.SHOW);
});
The code above works, except that after the export command, the lines of code below it only execute after some form of user interaction such as bringing up a context menu, selecting a dropdown value, etc. (clicking inside the screen does not work - it must be something registered as an interaction to DS). I confirmed that this behavior is not unique to my Analysis Application via a very basic test report with much simpler code/layout. In my case, the workaround I am using involves having a popup display with a "export successful" message that is before the export command in my code. The "OK" button that closes out the popup contains all code below the Export command above.
Are there any workarounds within my script that could control for this behavior besides having to add clicks for the user? I did not come across any non-SDK "wait" or similar functionalities.
Thanks
Scott