Jasper Report not downloading

0

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?

wcound's picture
4
Joined: Aug 10 2017 - 2:15pm
Last seen: 8 months 3 days ago

2 Answers:

0

Did you specify j_username and j_password in the GET url to login to JasperReports Server?

hozawa's picture
51278
Joined: Apr 24 2010 - 4:31pm
Last seen: 4 months 1 week ago
0

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.

 

wcound's picture
4
Joined: Aug 10 2017 - 2:15pm
Last seen: 8 months 3 days ago
Feedback