• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Jasper Reports

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Watchya got in that poodle gun? Anything for me? Or this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic