Hi,
I want to create a CSV report using Jasper.
The following code create a report as desired.
The problem is using it several time in a roll the following Error - "Caused by: java.lang.ClassNotFoundException
ori.jasper.engine.base.JRBaseRectangle"
when reaching .....JasperPrint jasperPrint = JasperFillManager.fillReport(in, parameters, Database.instance().getConnection());
Code:
ByteArrayOutputStream compiledOutput = new ByteArrayOutputStream();
System.setProperty("jasper.reports.compile.temp", Configuration.instance().getAdvantagTempFolder());
System.setProperty("jasper.reports.compile.class.path",
getServletContext().getRealPath("/WEB-INF/lib/jasperreports.jar"));
JasperCompileManager.compileReportToStream(new FileInputStream(xmlFileName), compiledOutput);
Map parameters = new HashMap();
ByteArrayInputStream in = new ByteArrayInputStream(compiledOutput.toByteArray());
response.setContentLength(compiledOutput.toByteArray().length);
compiledOutput.close();
ServletOutputStream out = response.getOutputStream();
JasperPrint jasperPrint = JasperFillManager.fillReport(in, parameters, Database.instance().getConnection());
.......
....
Why it works some of the times, and some it raises error after the above line?
Please advise
Thanks