hd_loki Posted March 26, 2008 Share Posted March 26, 2008 Hi, I inadvertantly searched iReports forum for tips on this and posted before going to the JasperReports forum. I am trying suggestions found there, but am not having any luck. I found one suggestion regarding unchecking the 'ignore pagination' option and tried that but it did not work for me. I looked for a possible overflow parameter on the exporter but could not find one. Can anyone who has solved this problem provide some context and a possible solution? ThanksPost edited by: hd_loki, at: 2008/03/26 16:37 Link to comment Share on other sites More sharing options...
hd_loki Posted March 27, 2008 Author Share Posted March 27, 2008 Here is the code I am using which I found on a post regarding the same topic: ServletOutputStream outstream = response.getOutputStream();response.setContentType("application/pdf");response.setContentLength(pdfasbytes.length);response.setHeader("Content-disposition","attachment; filename="runs.pdf"");response.setHeader("Expires","0");response.setHeader("Cache-Control","must-revalidate, post-check=0, pre-check=0");response.setHeader("Pragma","public"); //outstream.write(pdfasbytes);outstream.write(pdfasbytes,0,pdfasbytes.length);outstream.flush();outstream.close(); But this isn't working either. Please help. Thanks, Heather Link to comment Share on other sites More sharing options...
hd_loki Posted March 27, 2008 Author Share Posted March 27, 2008 So the issue did have to do with pagination, but in addition, I had to remove the call Code:response.setContentLength(pdfasbytes.length); and instead of Code:[code]outstream.write(pdfasbytes); I changed the outputstream.write method to include the length and offset Code:[code]outstream.write(pdfasbytes,0,pdfasbytes.length); in addition to unchecking the ignore pagination flag. :S 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