Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To render the button in the Dashboard portlet, use the DashboardController method addDownloadButton in the calculation logic. You can add URL parameters determining the output format and the name of the file.

Examples:

This backend call runs the specified dashboard logic, exports the data into the XLSX format and downloads the file with the specified name:

...

Code Block
controller.addDownloadButton('Download PDF','/formulamanager.executeformula/dashboard_export_logic?templateName=MyTemplate&output=pdf&fileName=MyDownloadedFile', '{"Param1":"Test01", "Param2":"Test02"}')

Often, you will need to use a variable in the fileName URL parameter to make the file name generation dynamic:

Code Block
def FileName = 'MyDownloadedFile' //or more typically a dynamically generated file name

controller.addDownloadButton('Download Excel','/formulamanager.executeformula/JJ_dashboard_export_logic?output=xls&fileName=' + FileName)

Note: If no file name URL parameter is set, the name consists of the (unique) name of the logic and the time stamp.