Running a Report

The PUT request for the report service runs the report and generates the specified output. The response contains the ID of the saved output for downloading later with a GET request.

Method

URL

PUT

http://<host>:<port>/jasperserver[-pro]/rest/report/path/to/report

Argument

Type/Value

Description

RUN_OUTPUT_FORMAT?

OutputType

The format of the report output. The possible values are: PDF, HTML, XLS, XLSX, RTF, CSV, XML, DOCX, ODT, ODS, JRPRINT. The Default is PDF.

<Resource
Descriptor>

String

Argument used to pass a transformer key to be used when running a report using JRPRINT as output format. The transformer key will be used to transform generic elements in the generated report as per net.sf.jasperreports.engine. export.GenericElementReportTransformer. This is a required argument when using multipart requests.

interactive?

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.

IMAGES_<br />URI?

String

The uri prefix used for images when exporting in HTML. The default is images.

X-Method-<br />Override?

POST

This method can be used to perform a POST instead of a PUT.

PAGE?

Integer > 0

An integer value used to export a specific page

ignore<br />Pagination

Boolean

When true, the report output will be generated on a single page in all export formats. When false or omitted, all export formats will be paginated.

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 body is XML containing a summary of the report execution (UUID, pages, generated files, etc...). See sample return below.

404 Not Found – When the specified report URI is not found in the repository.

The body of the PUT request should contain a resource descriptor of type reportUnit with the URI of the report unit to run. The resource descriptor can contain one or more parameter tags to specify parameters. Lists can be passed using parameters with the same name and the isListItem attribute set to true.

The arguments can be placed in the URL of the request or by encoding them in the multipart request. However, some application servers such as Apache Tomcat do not process arguments that are www-url-encoded in the request when sent to a PUT method, so be sure you are using a multipart request or you are using the GET style parameters when using this method.

The return value of the PUT request provides the UUID of the report output in this session and the ID of the files.

<report>
  <uuid>d7bf6c9-9077-41f7-a2d4-8682e74b637e</uuid>
  <originalUri>/reports/samples/AllAccounts</originalUri>
  <totalPages>43</totalPages>
  <startPage>1</startPage>
  <endPage>43</endPage>
  <file type="image/png">img_0_0_0</file>
  <file type="image/gif">px</file>
  <file type="text/html">report</file>
  <file type="image/jpeg">img_0_42_27</file>
  <file type="image/png">img_0_42_26</file>
</report>
Version: 
Feedback
randomness