How to refresh jasper image without flickering?
Posted
by Aru
on Stack Overflow
See other posts from Stack Overflow
or by Aru
Published on 2010-04-23T09:38:06Z
Indexed on
2010/04/23
9:43 UTC
Read the original article
Hit count: 424
jasper-reports
|jrxml
Hi, I am using jasper reports to generate graph. I am refresheing the graph. But the problem is while refreshing the graph it is flickering. Code is-
PrintWriter out = response.getWriter(); response.setContentType("text/html"); JRDataSource dataSource = createReportDataSource(perfArrayListSample.toArray());
ServletContext context = this.getServletConfig().getServletContext(); File reportFile = new File(context.getRealPath("/cpuUsageGraph.jasper")); if (!reportFile.exists()) throw new JRRuntimeException("File cpuUsageGraph.jasper not found. The report design must be compiled first.");
JasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile.getPath()); JasperPrint print = JasperFillManager.fillReport(jasperReport, 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();
So how to refresh the graph wihout flickering?
© Stack Overflow or respective owner