sweet_yangyz Posted August 3, 2009 Share Posted August 3, 2009 Hi: I used the jasperreport 3.5.3 in our project, and export pdf ,html, and xml all right, but when I export the report as a xls file,the exception will be threw like this:java.lang.NoSuchMethodError: org.apache.poi.hssf.usermodel.HSSFSheet.setColumnWidth(II)V at net.sf.jasperreports.engine.export.JRXlsExporter.setColumnWidth(JRXlsExporter.java:212) at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.setColumnWidths(JRXlsAbstractExporter.java:654) at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportPage(JRXlsAbstractExporter.java:527) at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReportToStream(JRXlsAbstractExporter.java:463) at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReport(JRXlsAbstractExporter.java:186) at net.sweet.test.report.DataSourceFactory.test_generateReport(DataSourceFactory.java:88) ......I want to kown that which version of POI will be referenced in jasperreport?I referenced the POI 3.0.2_FINAL in our project, can you help me ? Thx,Sweet. Code:JRXlsExporter exporter = new JRXlsExporter(); exporter .setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); FileOutputStream oStream = new FileOutputStream( "D:\\report\\log4j.xls"); exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, oStream); exporter.setParameter( JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE); exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE); exporter.setParameter( JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE); exporter.exportReport(); Link to comment Share on other sites More sharing options...
denys Posted August 4, 2009 Share Posted August 4, 2009 for version 3.5.2 pom.xml states: <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.2-FINAL</version> <scope>compile</scope> <optional>true</optional> </dependency> I would assume that 3.5.3 uses the same version of POI lib. Code: <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.2-FINAL</version> <scope>compile</scope> <optional>true</optional> </dependency> Link to comment Share on other sites More sharing options...
Teodor Danciu Posted August 5, 2009 Share Posted August 5, 2009 Hi, You can get the required POI library from the /lib directory of the JasperReports distribution package. I hope this helps.Teodor Link to comment Share on other sites More sharing options...
sweet_yangyz Posted August 6, 2009 Author Share Posted August 6, 2009 Thanks ,I try to replace the POI lib with 3.2 version instead of the one with 3.0.2, now it work well.Thanks again. :) Sweet Link to comment Share on other sites More sharing options...
Suite Posted November 12, 2009 Share Posted November 12, 2009 Thanks ,I replaced the the POI lib with 3.2 and now it is OK.Thanks to all 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