Do an Export from a script

To be able to do an export from a dasboard without using the share button at the top of the screen or right screen click. Add the following single line of code to a script.


new dundas.controls.ExportDialog().show()

Thanks Paul. There is a good example for the this setup under the script library:

https://www.dundas.com/support/developer/script-library/Export/Create-an-Export-for-a-Report

Is there any way to select what options are available for export, and what dashboard elements are available? Either totally or at least in the initial options in the popup?

If you go to the sample Ariel provided, there is a grey strip for Other Script Samples. You can find a few more options there. For example, the following sample lets you select which element to export:


https://www.dundas.com/support/developer/script-library/Export/Create-an-Export-for-a-Report

Do you mean limiting it via script or for standard users when using the UI? Aside from the script option mentioned above, you also have a "prevent data export" checkbox on the metric set settings that can be used to limit the export for specific metrics.



Prevent export helps for metric sets. It doesn't stop separate items for each object if you select image export does it?

An image export includes everything visible on the dashboard. You can add a script to the Before Export action of the dashboard to hide select objects.

This is exactly what I was looking for. A simple solution, and with tip on checking the prevent data export option, make for a simple and easy export solution. Thanks guys.