I am trying to integrate Jasper Reports into a java application useing the rest api.
Our server is jasperserver-pro 6.1.1 and I am calling it from a java application using java version 1.8.0_152.
I am running the application locally but the jasperserver is running on a remote server.
Using org.apache.http.client I am able to successfully do a POST call to the rest login,
then a GET call to retreive the requested report in pdf format. At this point I expected a
download of the file, but that is not happening. The call is successful and I am able to
print out the pdf results to a log file to confirm that the call is actually working.
When I look at the header results from the GET response I see that the value for
the Content-Disposition is attachment; filename="myFilename.pdf".
I assumed that the file would download to the client machine.
I have tried in both chrome and firefox thinking that it might be a browser issue, but I get the same results.
Anybody have any ideas?
2 Answers:
No I did not include the username and password to the GET. Only to the POST. Passing the username and password in the URL is not secure. The authentication from the post should be OK and since I am getting a status of 200 as well as the report results I would assume as far as the JasperReports server is concerned it has done its job. The missing piece is how to get the PDFs file to either download or open in a new browser window.
Hi wcoud, i have the same problem, could you tell me how you solved this problem?