2006 IR Open Dicussion Posted August 26, 2006 Share Posted August 26, 2006 By: frblusso - frblusso Virtualizer JRxlsExporter: ClassCastException 2006-02-21 08:08 hello I use jasper1.2.0 if I export in a xls format via JRXlsExporter, using virtualizer, I have this exception in a websphere 5.1 environnment: [21/02/06 16:40:42:769 CET] 6398133f WebGroup E SRVE0026E: [Erreur de servlet]-[net.sf.jasperreports.engine.base.JRVirtualPrintPage$JRIdHolderTemplateElement]: java.lang.ClassCastException: net.sf.jasperreports.engine.base.JRVirtualPrintPage$JRIdHolderTemplateElement at net.sf.jasperreports.engine.fill.JRTemplatePrintText.isStyledText(JRTemplatePrintText.java:291) at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.getStyledText(JRXlsAbstractExporter.java:422) at net.sf.jasperreports.engine.export.JRXlsExporter.exportText(JRXlsExporter.java:276) at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportPage(JRXlsAbstractExporter.java:367) at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReportToStream(JRXlsAbstractExporter.java:289) at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReport(JRXlsAbstractExporter.java:135) at com.airfrance.reporting.action.BenchAction.exportReportToBytes(BenchAction.java:448) at com.airfrance.reporting.action.BenchAction.benchJasper(BenchAction.java:390) at com.airfrance.reporting.action.BenchAction.lancerBench(BenchAction.java:140) ------------ the problem happens only if i use the virtalizer. here is the java code i use to export to excel. ------- JasperPrint jasperPrint = JasperFillManager.fillReport(name, parameters, dataSource); virtualizer.setReadOnly(true); response.setContentType("application/vnd.ms-excel"); JRXlsExporter exporter = new JRXlsExporter(); output = exportReportToBytes(jasperPrint, exporter); ----- and --- private byte[] exportReportToBytes(JasperPrint jasperPrint, JRExporter exporter) throws JRException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baos); exporter.exportReport(); return baos.toByteArray(); } could you help me, please? By: Lucian Chirita - lucianc RE: Virtualizer JRxlsExporter: ClassCastExcep 2006-02-23 01:47 Hello Using a virtualzier with the XLS exporter doesn't actually make sense unless JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET is set. When IS_ONE_PAGE_PER_SHEET is not set, the exporter creates a huge page by concatenating all the pages in the report, therefore keeping the entire report in memory. We'll try to find a solution for this. In the mean time, you can either set IS_ONE_PAGE_PER_SHEET or not use a virtualizer. Regards, Lucian Link to comment Share on other sites More sharing options...
andfedotov Posted December 4, 2006 Share Posted December 4, 2006 Hello!I've met the same problem with using virtializer when exporting report to the xls format.Could you please tell me if this bug was fixed?Actually it's not so easy task to remove using virtualizer for xls reports in our system...Thanks in advance! Link to comment Share on other sites More sharing options...
lucianc Posted December 4, 2006 Share Posted December 4, 2006 The bug is still open, since we have not found a satisfying fix for it. Regards,Lucian Link to comment Share on other sites More sharing options...
jkraemer Posted January 3, 2007 Share Posted January 3, 2007 Was this issue ever resolved? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now