Exporting a Dashboard from Code
Our sample projects and report templates can help you learn the basics of working with our products.A dashboard can be rendered and exported directly from code — the export format is chosen from the request and applied client-side.
Load, then export to a chosen format.
How it works. The export is emitted as client-side JS, so the browser produces the file without a server-rendering step.
Load, then export to a chosen format.
report = StiReport()
if report.processRequest(request):
return report.getFrameworkResponse()
report.loadFile(url_for('static', filename='reports/WebsiteAnalytics.mrt'))
exportFormat = StiExportFormat.PDF # or EXCEL, HTML, DOCUMENT
report.exportDocument(exportFormat)report.exportDocument(format)— emits the client-side JS that exports the dashboard.- The
StiExportFormatenum (PDF/EXCEL/HTML/…) selects the output type, driven here by a request parameter.
How it works. The export is emitted as client-side JS, so the browser produces the file without a server-rendering step.