Groups > Weblogic > WebLogic Servlet > Issue when opening pdf using Jasper Report in WLS 9.2




Issue when opening pdf using Jasper Report in WLS 9.2

Issue when opening pdf using Jasper Report in WLS 9.2
Tue, 29 Jan 2008 00:42:46 -080
hi 
I am new to jasper reports and I am using them in Java Page Flow in bea workshop
9.2 Jasper Report 2.0.4
Created .jasper using iReport 
In one of my action methods 
ServletOutputStream servletOutputStream = getResponse().getOutputStream(); 

InputStream reportStream =
getServlet().getServletConfig().getServletContext().getResourceAsStream("/c
lassic.jasper"); 

JasperRunManager.runReportToPdfStream(reportStream, servletOutputStream, new
HashMap() ,connection); 

getResponse().setContentType("application/pdf"); 

servletOutputStream.flush(); 
servletOutputStream.close(); 
connection.close(); 

When I invoke this action method from another page on click of submit , the pdf
file opens fine for the first time wiht all the data in the pdf ( first submit)
, and then I closed the pdf  and if I click on submit again, it fails to open
the pdf with the error message , 

There was an error opening this document . This file cannot be found. 
However if I keep any pdf / adobe  open it is able to open the pdf for mulitple
request (submits )
if I close the pdf it is able to generate the pdf only for the first time and
not the second time. 

Please help me resolve the issue, its urgent. 

thanx in advance
Madhusudan
Post Reply
about | contact