wcound Posted June 15, 2018 Share Posted June 15, 2018 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 adownload 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 More sharing options...
hozawa Posted June 16, 2018 Share Posted June 16, 2018 Did you specify j_username and j_password in the GET url to login to JasperReports Server? Link to comment Share on other sites More sharing options...
wcound Posted June 18, 2018 Author Share Posted June 18, 2018 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 More sharing options...
rene.marquez Posted May 21, 2020 Share Posted May 21, 2020 Hi wcoud, i have the same problem, could you tell me how you solved this problem? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now