jasper Chart can't be displayed using tomcat

Posted by Aru on Stack Overflow See other posts from Stack Overflow or by Aru
Published on 2010-05-12T04:04:39Z Indexed on 2010/05/12 4:14 UTC
Read the original article Hit count: 356

Filed under:
|

Hi,

I am using jasperreports-3.5.0 to generate timeSeries chart.

When I run it through eclipse it is working fine.

But if I create .war file of project and run through tomcat by deploying the project into tomcat / webapps folder then chart can not be displayed.

What could be the problem?

code:

PrintWriter out = response.getWriter(); response.setContentType("text/html"); JRDataSource dataSource = createReportDataSource(perfArrayListSample.toArray());

InputStream input = getServletConfig().getServletContext().getResourceAsStream("/CpuUsage.jrxml"); JasperDesign design = JRXmlLoader.load(input); JasperReport report = JasperCompileManager.compileReport(design);

JasperPrint print = JasperFillManager.fillReport(report, new HashMap(), dataSource);

JRHtmlExporter exporter = new JRHtmlExporter();

request.getSession().setAttribute(ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE, print); exporter.setParameter(JRExporterParameter.JASPER_PRINT, print); exporter.setParameter(JRExporterParameter.OUTPUT_WRITER, out); exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "image?ver="+new Date().getTime() +"&image="); exporter.exportReport(); perfArrayListSample.clear();

© Stack Overflow or respective owner

Related posts about jasper-reports

Related posts about tomcat