When the user exports a report in the viewer, the result can be sent back to the server and saved, through the onEndExportReport event.

Save the exported bytes in the event.
def endExportReport(args: StiExportEventArgs):
    filePath = os.path.normpath(os.getcwd() +
        url_for('static', filename='reports/' + args.fileName))
    with open(filePath, mode='wb') as file:
        file.write(args.data)
    return f'The exported report was saved to {args.fileName}.'

viewer.onEndExportReport += endExportReport

How it works. The exported file travels from the client viewer to the Python event, so exports can be stored server-side automatically.

By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.