sinsand Posted June 29, 2016 Share Posted June 29, 2016 HI All,we have a report deployed in jasperserver, From the browser when we generate the report with output as csv the report is generated and downloaded.When we copy the url for that report and try it in another tab then also the report is getting downloaded.But when we try to get the same report from java code instead of getting a csv file of the report we are getting html code.We tried few different ways to download it but in each file we are getting some html code.the latest we tried was FileUtils.copyURLToFile(new URL(loginURL), new File("d:/test3.csv"));Is there something more to be done to get the generated report in csv from Java code or am I missing something??Thanks,Sandeep Link to comment Share on other sites More sharing options...
sinsand Posted June 29, 2016 Author Share Posted June 29, 2016 HI All,Found the error, as my java requests were not authnticated due to which I was getting the login page.I am going to add token based authntication in java code and then try to generate it.Thanks,Sandeep Link to comment Share on other sites More sharing options...
hozawa Posted June 29, 2016 Share Posted June 29, 2016 The html page you were getting is probably an authentication error page. Just add j_username and j_password parameters to the server uri. 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