Meaningless Drivel is fun!*
The moose likes Other Open Source Projects and the fly likes Jasper Reports Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Jasper Reports" Watch "Jasper Reports" New topic
Author

Jasper Reports

pradeep kandakurti
Greenhorn

Joined: Jan 11, 2008
Posts: 3
I'm using jasper report in my project. Whenever i shutdown the tomcat and start again
i found the jasper reports are not displayed ie., it is throwing white page.
Tomcat resides in Server machine. If i want to get the jasper report again
i have to restart the tomcat .
I'm using this code in My Action Class

ServletContext application=getServlet().getServletConfig().getServletContext();
String path = application.getRealPath("/")+"jrxml";
System.out.println("Path Of The File "+path);
JasperPrint jasperPrint = JasperFillManager.fillReport(path + "/" + filename,pm, con);
OutputStream ouputStream = response.getOutputStream();
JRExporter exporter = null;
response.setContentType("application/rtf");
response.setHeader("Content-Disposition", "inline; filename=\"file.rtf\"");
exporter = new JRRtfExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, ouputStream);
try {
exporter.exportReport();
}
catch (JRException e)
{
throw new ServletException(e);
}
catch(java.lang.NullPointerException n)
{
System.out.println("Error "+n.getMessage());
}
finally
{
ouputStream.close();
con.close();
}




Kindly suggest me a solution
 
Don't get me started about those stupid light bulbs.
 
subject: Jasper Reports
 
Similar Threads
java.lang.IllegalStateException:- when generating excel report
Same Jasper Report keeps opening
Jasper Reports getting resubmitted to a servlet
Jasper Reports Excel Output
Excel reporting through Jasperreports