sjongenelen Posted November 11, 2009 Share Posted November 11, 2009 I've recently upgraded JasperReports on my JasperServer (pro) from 3.5.0 to 3.6.1 (from iReport).this worked suprisingly well :DI have updated the following Jar's:jasperreports-chart-themes-3.5.3.jarjasperreports-3.6.1.jarjasperreports-extensions-3.5.3.jarjasperreports-fonts-3.6.1.jarI placed them into"C:\Program Files\jasperserver-pro-3.5.1\apache-tomcat\webapps\jasperserver-pro\WEB-INF\lib"I have removed the following Jar's:jasperreports-3.5.0-Mondrian-3.1.1.jarjasperreports-chart-themes-3.5.0.jarjasperreports-ofc-component-0.0.2.2.jarSince this update, all my reports are no long exportable to MS Excel! All other exports work, but Excel gives the following error: Error Trace: java.lang.NullPointerException Link to comment Share on other sites More sharing options...
marciux Posted November 11, 2009 Share Posted November 11, 2009 Hi, I got same error but using runtime generation with jasperReport :It seem work fine only setting the parameter for the exporter (JRXlsExporter) : JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET to TRUEIf I try to set the parameter to FALSE I get the same error as sjongenelen. Link to comment Share on other sites More sharing options...
sjongenelen Posted November 13, 2009 Author Share Posted November 13, 2009 you sir, are my hero for today! i edited %program files%\jasperserver-pro-3.5.1\apache-tomcat\webapps\jasperserver-pro\WEB-INF\applicationContext.xml and changed <property name="onePagePerSheet" value="TRUE"/> thank you! Link to comment Share on other sites More sharing options...
marciux Posted November 13, 2009 Share Posted November 13, 2009 I'm happy for you, but for me this is a problem because I need to generate only one sheet per page and I don't know what to do for get it. Link to comment Share on other sites More sharing options...
sjongenelen Posted November 13, 2009 Author Share Posted November 13, 2009 i would like to use it too ofcourse. Is this a bug? any ideas? edit: workaround found (not real nice, but still)change the page height (pageHeight="842" in the XML) to something like 100000 :)Post Edited by sjongenelen at 11/13/2009 12:31 Link to comment Share on other sites More sharing options...
marciux Posted November 13, 2009 Share Posted November 13, 2009 I think that may be a bug! Your workaround isn't good for me, i should use same template to exporting in other format types. However i will try with your workaround just for curiosity. Thank you! Link to comment Share on other sites More sharing options...
swood Posted November 15, 2009 Share Posted November 15, 2009 Folks, You can't expect updating the JasperReports jars to work. There are many parts of the server that depend on the JasperReports APIs and they change slightly from version to version. Jaspersoft cannot support you if you do this. ShermanJaspersoft Link to comment Share on other sites More sharing options...
marciux Posted November 16, 2009 Share Posted November 16, 2009 Hi Sherman,I don't use Jasper Server but i've got the same error of sjongenelen. I had downloaded jasperReport 3.6.1. I use Struts 2 framework but i don't use the struts plugin for jasperReport I think that may be there is a problem in the jasperReport 3.6.1This is the error that i got16 nov 2009 09:23:07,791 ERROR http-8080-Processor24 test.JReportAction - java.lang.NullPointerException at net.sf.jasperreports.engine.export.CutsInfo.isCutNotEmpty(CutsInfo.java:147) at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.setColumnWidths(JRXlsAbstractExporter.java:662) at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReportToStream(JRXlsAbstractExporter.java:453) at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReport(JRXlsAbstractExporter.java:185) at it.mito.sapi.action.MitoReportActionSupport.getReportStream(MitoReportActionSupport.java:144) at it.mito.sapi.action.test.JReportAction.execute(JReportAction.java:65) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)..... If i change the value of JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET from false to true and it work fine. I forget something in the code?!Do you have any suggestions for me? thanks in advance Marciux.Code://Gets the JasperPrintJasperPrint jasperPrint = JasperFillManager.fillReport(reportInputStream, getReportParams(), dataSource);JRAbstractExporter exporter = null;switch (reportType) { case XLS: exporter = new JRXlsExporter();//Create XLS Exporter exporter.setParameter(JRXlsExporterParameter.OFFSET_X, 0); //this work fine //exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE); //TODO : get error, fix problem exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE); exporter.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE); exporter.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE); break; case PDF: exporter = new JRPdfExporter();//Create PDF Exporter break; case CSV: exporter = new JRCsvExporter();//Create CSV Exporter break; }//Output Stream for exporterByteArrayOutputStream baou = new ByteArrayOutputStream(1024);//Sets the output streamexporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baou); //Sets the jasper printexporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); //Export the reportexporter.exportReport();//Returns the report input streamreturn new ByteArrayInputStream(baou.toByteArray()); Link to comment Share on other sites More sharing options...
csimon3 Posted December 1, 2009 Share Posted December 1, 2009 Got the same problem. Upgrade to 3.6.2 solved the problem! Link to comment Share on other sites More sharing options...
cchiappe Posted March 26, 2010 Share Posted March 26, 2010 There seems to be a bug with the JRXlsExporter, when I exported a report using it, an error message appeared saying there was a problem with the file, that it could be incomplete or something (and indeed it was). I couldn't find a solution using the JRXlsExporter, but i found a workaround, you should try using the class JExcelApiExporter instead of a JRXlsExporter:in JAVA: JExcelApiExporter exp = new JExcelApiExporter(); exp.setParameter(JRExporterParameter.JASPER_PRINT, jprint); exp.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, reportPath + fileReportName); exp.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE); exp.setParameter(JRXlsExporterParameter.IS_COLLAPSE_ROW_SPAN,Boolean.TRUE); exp.exportReport();in iReport:Go to the Preview tab and select "Xls Preview (Using JExcelApi)". Hope this helps, C.Chiappe Link to comment Share on other sites More sharing options...
swood Posted March 29, 2010 Share Posted March 29, 2010 The JExcelApiExporter provides a better result than the XlsExporter. In JasperServer, the JExcelApiExporter is used. ShermanJaspersoft 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