The new v2/reports service allows clients to receive report output in a single request-response. The output format is specified in the URL as a file extension to the report URI.
Method | URL | ||
GET | http://<host>:<port>/jasperserver[-pro]/rest_v2/reports/path/to/report.<format>?<arguments> | ||
Argument | Type/Value | Description | |
<format> | output type | One of the following formats: pdf, html, xls, xlsx, rtf, csv, xml, docx, odt, ods, jprint. | |
page? | Integer > 0 | An integer value used to export a specific page | |
<inputControl> | String | Any input control that is defined for the report. Input controls that are multi-select may appear more than once. See examples below. | |
Boolean | In a commercial editions of the server where HighCharts are used in the report, this property determines whether the JavaScript necessary for interaction is generated when exporting to HTML. By default it is true. If set to false, the chart is generated as a non-interactive image file. | ||
onePagePerSheet? | Boolean | Valid only for the XLS format. When true, each page of the report is on a separate spreadsheet. When false or omitted, the entire report is on a single spreadsheet. If your reports are very long, set this argument to true, otherwise the report will not fit on a single spreadsheet and cause an error. | |
Return Value on Success | Typical Return Values on Failure | ||
200 OK – The content is the requested file. | 404 Not Found – When the specified report URI is not found in the repository. |
The follow examples show various combinations of formats, arguments, and input controls:
http://<host>:<port>/jasperserver[-pro]/rest_v2/reports/reports/samples/AllAccounts.html (all pages)
http://<host>:<port>/jasperserver[-pro]/rest_v2/reports/reports/samples/AllAccounts.html?page=43
http://<host>:<port>/jasperserver[-pro]/rest_v2/reports/reports/samples/AllAccounts.pdf (all pages)
http://<host>:<port>/jasperserver[-pro]/rest_v2/reports/reports/samples/AllAccounts.pdf?page=1
http://<host>:<port>/jasperserver[-pro]/rest_v2/reports/reports/samples/EmployeeAccounts.html?EmployeeID=sarah_id
http://<host>:<port>/jasperserver[-pro]/rest_v2/reports/reports/samples/Cascading_multi_select_report.html?
Country_multi_select=USA&Cascading_state_multi_select=WA&Cascading_state_multi_select=CA
JasperReports Server does not support exporting Highcharts charts with background images to PDF, ODT, DOCX, or RTF formats. When exporting or downloading reports with Highcharts that have background images to these formats, the background image is removed from the chart. The data in the chart is not affected. |
Recommended Comments
There are no comments to display.