Registering a Data from Code
Our sample projects and report templates can help you learn the basics of working with our products.Data can be supplied from the server through the
Handle the data event.
How it works. The event lets code decide the report's data at request time, so the template need not carry its own connections.
onBeginProcessData event instead of being stored in the template.Handle the data event.
viewer = StiViewer()
# String name -> JavaScript client-side handler; a function -> Python server-side handler
viewer.onBeginProcessData += 'beginProcessData'
report = StiReport()
report.loadFile(url_for('static', filename='reports/SimpleList.mrt'))
viewer.report = reportviewer.onBeginProcessData += handler— fires when the report requests data; supply or override it here.- A string name runs a JavaScript handler on the client; a Python function runs on the server.
How it works. The event lets code decide the report's data at request time, so the template need not carry its own connections.