Sukumesh Posted July 28, 2006 Share Posted July 28, 2006 Hi, I integrated jasper1.2.5 and Tried for PDF report tht is working very fine. Then I tried to Create Excel export using JExcelApiExporter. But i am getting the Follwing error [junit] common.Assert.verify(Z)V [junit] java.lang.NoSuchMethodError: common.Assert.verify(Z)V [junit] at jxl.biff.XFRecord.<init>(XFRecord.java:447) [junit] at jxl.write.biff.CellXFRecord.<init>(CellXFRecord.java:50) [junit] at jxl.write.WritableCellFormat.<init>(WritableCellFormat.java:87) [junit] at jxl.write.WritableWorkbook.<clinit>(WritableWorkbook.java:56) [junit] at jxl.Workbook.createWorkbook(Workbook.java:393) [junit] at jxl.Workbook.createWorkbook(Workbook.java:376) [junit] at net.sf.jasperreports.engine.export.JExcelApiExporter.openWorkbook(JExcelApiExporter.java:153) [junit] at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReportToStream(JRXlsAbstractExporter.java:229) [junit] at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReport(JRXlsAbstractExporter.java:135) Pls anybody cna help me to solve this error? Thangs & Regards,Suresh Link to comment Share on other sites More sharing options...
lucianc Posted July 28, 2006 Share Posted July 28, 2006 Could you check that you only have one JExcel jar on your classpath? Or maybe the common.Assert class is part of another jar in your classpath. HTH,Lucian Link to comment Share on other sites More sharing options...
Sukumesh Posted July 31, 2006 Author Share Posted July 31, 2006 Hi, I am having one Jexcel,jar and jxl.jar,xlrd.jar in my Classpath......... And Struts libs(i mean commons.......jars) is there any other jar containing commons method? Pls help me Thanks & Regards,Suresh Link to comment Share on other sites More sharing options...
Sukumesh Posted July 31, 2006 Author Share Posted July 31, 2006 Hi, I removed the Jexcel.jar and cleaned the src. Again Replaced the Jexcel.jar so now i am getting the Follwing error [junit] java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 [junit] at java.util.ArrayList.RangeCheck(ArrayList.java:507) [junit] at java.util.ArrayList.get(ArrayList.java:324) [junit] at jxl.write.biff.WritableWorkbookImpl.getSheet(WritableWorkbookImpl.java:382) [junit] at jxl.write.biff.WritableWorkbookImpl.write(WritableWorkbookImpl.java:825) [junit] at net.sf.jasperreports.engine.export.JExcelApiExporter.closeWorkbook(JExcelApiExporter.java:177) [junit] at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReportToStream(JRXlsAbstractExporter.java:305) [junit] at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReport(JRXlsAbstractExporter.java:135) And this is my Code JasperPrint jPrint = JasperFillManager.fillReport(dirName+"ExcelReport.jasper",parameters,jrDataSource);ByteArrayOutputStream outputByteArray = new ByteArrayOutputStream();JExcelApiExporter exporterXLS = new JExcelApiExporter(); exporterXLS.setParameter(JExcelApiExporterParameter.JASPER_PRINT, jPrint); exporterXLS.setParameter(JExcelApiExporterParameter.OUTPUT_STREAM,outputByteArray); exporterXLS.setParameter(JExcelApiExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE); exporterXLS.setParameter(JExcelApiExporterParameter.IS_AUTO_DETECT_CELL_TYPE, Boolean.TRUE); exporterXLS.setParameter(JExcelApiExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.TRUE); exporterXLS.setParameter(JExcelApiExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS,Boolean.TRUE); exporterXLS.exportReport(); byte[] byteArray = outputByteArray.toByteArray(); While Excuting this Code for PDF tht is working FineFor Excel now I am getting the Follwing Error. Pls Help Me Thanks,Suresh Link to comment Share on other sites More sharing options...
lucianc Posted July 31, 2006 Share Posted July 31, 2006 This error usually occurs when you're trying to export an empty report. To avoid it, check the number of pages in the report before exporting. HTH,Lucian Link to comment Share on other sites More sharing options...
rajil Posted July 26, 2008 Share Posted July 26, 2008 check version of iTextit must be itext-1.3.1.jar and delete if older version is available in lib folder. 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