Hi Mallik, So how can i resolve the problem. Here is my code: reportPath = request.getParameter("_reportName"); /* * Instantiate ReportClientDocument and specify the Java Print Engine as the report processor. * Open a rpt file and export to PDF. Stream PDF back to web browser. */ reportClientDocument.setReportAppServer(ReportClientDocument.inprocConnectionString); reportClientDocument.open(reportPath, OpenReportOptions._openAsReadOnly); reportSource = reportClientDocument.getReportSource(); session.setAttribute("ReportSource", reportSource); System.out.println("hi+temp+final"); byteArrayInputStream = (ByteArrayInputStream) reportClientDocument .getPrintOutputController().export(ReportExportFormat.PDF); response.reset(); response.setHeader("Content-disposition", "inline;filename=crreport.pdf"); response.setContentType("application/pdf"); System.out.println("Hello"); byteArray = new byte[1024]; while((bytesRead = byteArrayInputStream.read(byteArray)) != -1) { response.getOutputStream().write(byteArray, 0, bytesRead); } //response.getOutputStream().flush(); response.getOutputStream().close(); reportClientDocument.close(); Thanks Penchal | 0 |
By: [email protected] On: Tue Oct 07 17:27:00 IST 2014 21 15 0 | 36 |
Are You Satisfied :0Yes0No |
1 down vote Add the following inside the end of the try/catch to avoid the error that appears when the JSP engine flushes the response via getWriter() out.clear(); // where out is a JspWriter out = pageContext.pushBody(); This isn't best practice, but it avoids the errors in your logs. Ideally we should do this in Servlet and not in JSP. If you still needs it in JSP, follow above code to get rid off the error. | 0 |
By: [email protected] On: Sat May 16 11:54:40 IST 2015 0 0 0 | 0 |
Are You Satisfied :0Yes0No |