After requesting a report execution and waiting synchronously or asynchronously for it to finish, your client is ready to download the report output.
Every export format of the report has an ID that is used to retrieve it. For example, the HTML export in the previous example has the ID 195a65cb-1762-450a-be2b-1196a02bb625. To download the main report output, specify this export ID in the following method:
Method | URL | ||
GET | http://<host>:<port>/jasperserver[-pro]/rest_v2/reportExecutions/requestID/exports/exportID/outputResource | ||
Response Header | Description | ||
output-final | As of JasperReports Server 5.6, this value indicates whether the out put is in its final form or not. When false, report items such as total page count are not finalized, but output is available early. You should reload the output resource again until this value is true. | ||
Return Value on Success | Typical Return Values on Failure | ||
200 OK – The content is the main output of the report, in the format specified by the contentType property of the outputResource descriptor, for example: text/html | 404 Not Found – When the request ID specified in the request does not exist. |
For example, to download the main HTML of the report execution response above, use the following URL:
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. |
To download file attachments for HTML output, use the following method. You must download all attachments to display the HMTL content properly. The given URL is the default path, but it can be modified with the attachmentsPrefix property in the reportExecutionRequest, as described in Report Execution Properties.
Method | URL | ||
GET | http://<host>:<port>/jasperserver[-pro]/rest_v2/reportExecutions/requestID/exports/exportID/attachments/fileName | ||
Return Value on Success | Typical Return Values on Failure | ||
200 OK – The content is the attachment in the format specifiedin the contentType property of the attachment descriptor, for example: image/png | 404 Not Found – When the request ID specified in the request does not exist. |
For example, to download the one of the images for the HTML report execution response above, use the following URL:
Recommended Comments
There are no comments to display.