2005 IR Help Posted August 26, 2006 Share Posted August 26, 2006 By: Jeffrey S. Hair - jshair Problem streaming PDF to IE using SSL 2004-06-16 15:14 I'm using Struts action classes to handle requests. For reports, it then calls into my backend code to execute the report and stream back the byte[]. Once the Action class has the byte[], I set the following in the response: setContentType("application/pdf"); setContentLength(reportBytes.length); Then I write the byte[] into the response's outputStream, flush, and close. All of this works perfect when using a non-secure site (ie. no SSL). When I try to deploy this to a site using SSL, IE complains stating that "... Internet Explorer was not able to open this Internet site..." I have struts nocache set to true. Setting this to false does not make any difference. I've tried physically setting 'Pragma' and 'Cache-control' to be empty and have set the 'Content-disposition' to 'attachment; filename="example.pdf"'. And still no change. What am I missing? I've been trying to crack this nut, off & on, for several weeks. Thanx, jsh By: Jeffrey S. Hair - jshair RE: Problem streaming PDF to IE using SSL 2004-06-16 17:53 I found this posting and added "Expires" but it still didn't work. https://sourceforge.net/forum/message.php?msg_id=2124250 Any other suggestions? jsh By: GTI - gtigti RE: Problem streaming PDF to IE using SSL 2004-06-18 02:41 I suggess you export to a pdf file and then display it on the browser. you have to export with these options : exporter.setParameter(JRPdfExporterParameter.IS_ENCRYPTED, Boolean.TRUE); exporter.setParameter(JRPdfExporterParameter.IS_128_BIT_KEY, Boolean.TRUE); By: Jeffrey S. Hair - jshair RE: Problem streaming PDF to IE using SSL 2004-06-18 04:49 I'm currently using JasperRunManager.runReportToPdf() to get the byte[] and then am streaming it back. I've not seen any examples of using the JRPdfExporter (still looking). What other parameters are needed when using this exporter? Thanx, jsh By: Chuck Deal - cdeal RE: Problem streaming PDF to IE using SSL 2004-06-18 05:14 Take a look at the source code for the JasperRunManager.runReportToPdf() method. If it is not using the JRPdfExporter, then a method that it is calling is... You can get the sample code you need from one of those methods. By: GTI - gtigti RE: Problem streaming PDF to IE using SSL 2004-06-21 08:43 JRPdfExporter exporter = new JRPdfExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_FILE, destFile); exporter.setParameter(JRPdfExporterParameter.IS_ENCRYPTED, Boolean.TRUE); exporter.setParameter(JRPdfExporterParameter.IS_128_BIT_KEY, Boolean.TRUE); exporter.setParameter(JRPdfExporterParameter.USER_PASSWORD, "xx"); (optional) exporter.setParameter(JRPdfExporterParameter.OWNER_PASSWORD, "xy"); (optional) exporter.setParameter( JRPdfExporterParameter.PERMISSIONS, new Integer(PdfWriter.AllowCopy | PdfWriter.AllowPrinting) ); exporter.exportReport(); 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