Jump to content

Jasper Report not downloading


Recommended Posts

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?

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

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.


Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...