The rest_v2/reports service has a simple API for obtaining report output, such as PDF and XLS. The service also provides functionality to interact with running reports, report options, and input controls.
Running a Report
The reports service allows clients to receive report output in a single request-response. The reports service is a synchronous request, meaning the caller will be blocked until the report is generated and returned in the response. For large datasets or long reports, the delay can be significant. If you want to use a non-blocking (asynchronous) request, see REST API Reference - The reportExecutions Service
The output format is specified in the URL as a file extension to the report URI.
Method | URL | ||||||||
GET | http://<host>:<port>/jrio/rest_v2/reports/path/to/report.<format>?<arguments> | ||||||||
Argument | Type/Value | Description | |||||||
<format> | output | One of the following formats:
| |||||||
page? | Integer > 0 | An integer value used to export a specific page. | |||||||
anchor? | String | An anchor name in the generated report. | |||||||
ignore pagination? | Boolean | When set to true, the report will be generated as a single page. This can be useful for some formats such as csv. When omitted, this argument's default value is false and the report is paginated normally. | |||||||
<parameter> | String | Any parameter that is defined for the report. Parameters that are multivalue may appear more than once. See examples below. | |||||||
baseUrl | String | Specifies the base URL that the report will use to load static resources such as JavaScript files. | |||||||
attachments | attachments | For HTML output, this property specifies the URL path to use for downloading the attachment files (JavaScript and images). | |||||||
Return Value on Success | Typical Return Values on Failure | ||||||||
200 OK – The content is the requested file. | 400 Bad Request – When incorrect format is provided in the Get request. 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>/jrio/rest_v2/reports/samples/reports/FirstJasper.html (all pages)
http://<host>:<port>/jrio/rest_v2/reports/samples/reports/FirstJasper.html?page=5
http://<host>:<port>/jrio/rest_v2/reports/samples/reports/FirstJasper.pdf (all pages)
http://<host>:<port>/jrio/rest_v2/reports/samples/reports/FirstJasper.pdf?page=5
JasperReports IO 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.