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.

Hallo! Brauchen Sie Hilfe?