magarciaschopohl
magarciaschopohl

Reputation: 345

Generate report in JasperServer via REST in jrprint format

Working with jasperserver 4.7.0. Using the REST API (rest_v2), I want to generate a report in jrprint format. After JasperServer's documentation, this is the URL I have to use:

http://:/jasperserver[-pro]/rest_v2/reports/path/to/report.format?arguments where format is one of the following: html, pdf, xls, rtf, csv, xml, jrprint

After having properly configured a report in my JasperServer instance, I call the URL following the instructions, like so (for a PDF):

http://localhost:8080/jasperserver/rest_v2/reports/reports/test/example.pdf

And it works fine. However, if I change the format to JRPRINT:

http://localhost:8080/jasperserver/rest_v2/reports/reports/test/example.jrprint

then I get a 404 (Not Found) error!

The suffix "jrprint" is correct because if I use any other (invented) one, I get a 400 (Bad request) error.

So the question is: do I have to configure anything special in the JasperServer engine in order to serve JRPRINT reports? Or is there anything I must take into account when placing the call from the client browser?

Upvotes: 2

Views: 3533

Answers (1)

lionel
lionel

Reputation: 33

Try the following:

GET http://localhost:8080/jasperserver/rest_v2/reports/reports/test/example.jrprint

As you said, you get a "404 (Not Found)". But, right after that, try this:

GET http://localhost:8080/jasperserver/rest_v2/reports/reports/test/example.jasperPrint

And now you should get "200 (OK)", andt the JasperPrint data in the body. I do not understand why, but this worked for me with JasperServer ver. 5.0.0.

Upvotes: 1

Related Questions