JasperReports Report Templates#

You create a JasperReports report using a JasperReports report template. A report template can have its own filter configuration or use the filtered set of items from the item overview.

Reports are based on data sources and report templates. The data source determines the amount of items, that you receive in a report. The report template defines the layout and visual appearance of the item data.

The report template engine allows you to preprocess data with XSLT stylesheets. The stylesheets are part of the template and are executed on the server, before the formatting part of the report template is executed. This allows great flexibility in the processing and presentation of items.

Report templates take a list of items and format them in the way defined in the template. Most examples that come with Allegra are templates for PDF output. There are reports with and without history, grouping, localization, and diagrams.

There are two ways to access reports: via the Actions button in the item overview or via the toolbar button “Reports”. In the first case, if the report template is allowed, you will not be asked for which items you want to create a report. In the second case, you will always be prompted to use filter criteria for the report. In the following, we assume the second approach.

  • Select Reports from the main toolbar.

../../_images/manageReport1.png
  • Open one of the folders on the left side. On the right side, you should receive a list of report templates in this folder. If you hover over the name of the report template on the right side, you will see a preview of the report.

../../_images/manageReport2.png
  • Select the desired report template and click on the “Create report” button in the toolbar.

../../_images/manageReport3.png
  • Depending on the selected report template, you now need to specify a filter. You create the report by clicking on the “Create report” button. If you click on the “XML data source” button, you can download an XML file that represents sample data for this type of report template. You can use this XML file as test data when you modify the report template locally on your computer.

../../_images/manageReport4.png