The reporting tool allows you to print a report from code. To achieve this, you can utilize the special print() method on the report object.

 

app.py

 

report = StiReport()

report.loadFile(url_for('static', filename='reports/SimpleList.mrt'))

report.print()

 

 

 

By default, all pages of the generated report will be printed. It is possible to specify a page or range of pages to print. To achieve this, simply pass the required value as a parameter to the print() function. For example:

 

app.py

 

report = StiReport()

report.loadFile(url_for('static', filename='reports/SimpleList.mrt'))

 

report.print(5)

report.print('1,3-8')