Export with Jasper Report

This section shows how to use Jasper iReport to integrated export of the report results.

Preparation

Install iReport * Visit Jasper report homepage to download and install.

Add {APP_HOME}/WebContent/launcher/custom/custom.export.jasper.js file on javascript section on {APP_HOME}/WebContent/launcher/analytics.jsp.

Create Report

Using iReport, create report template and save the file with jrxml extension. Move this file to {APP_HOME}/template/jasper to register template lists.

Report Templates

When you request a report / dashboard output, you can link data to Jasper reports through XML data binding.

If the key value of the table entry is a value of type report_0_grid, the grid output result is output to the corresponding table.

If the key value of the image item is a value of type report_0_chart, the chart image can be output to the report.

The grid / chart is automatically deleted if there is no data.

If there is a key value of the grid item, the following data source is automatically registered in the table.

((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).dataSource("/reportset/report_0/data")

 

To use a separate custom item, you must develop the jasper report jrxml file through the data-linked XML file created in the temp folder and register it in the template folder.