views:

15

answers:

0

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();