Search code examples
jasper-reports

how to get .jasper and .bak and also view direct excel in iReport 2.0.2


I have problems to view report. first, when I try to click view button on the excel button in 'build'. it not view out the report but it is just generate excel files in a folder only. Secondly, Can I get the file .Jasper and .bak after I view the report.

The main problem is when i want to view direct my report for excel. The error show:-

  Exporting XLS to file (using POI)... .\senarai_cpp_4(1)_tnsparthis_pembaharuanPenangguhan.xls.
Error exporting print... Sheet name cannot be blank, greater than 31 chars, or contain any of /\*?[] 
Can't find the translation for key = iReportCompiler.errorExportingPrint: using default (Error exporting print... {0} )  java.lang.IllegalArgumentException: Sheet name cannot be blank, greater than 31 chars, or contain any of /\*?[]      at org.apache.poi.hssf.record.BoundSheetRecord.setSheetname(BoundSheetRecord.java:162)      at org.apache.poi.hssf.model.Workbook.setSheetName(Workbook.java:464)      at org.apache.poi.hssf.usermodel.HSSFWorkbook.createSheet(HSSFWorkbook.java:540)      at net.sf.jasperreports.engine.export.JRXlsExporter.createSheet(JRXlsExporter.java:147)      at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReportToStream(JRXlsAbstractExporter.java:393)      at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReport(JRXlsAbstractExporter.java:221)      at it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:1329)      at java.lang.Thread.run(Unknown Source)  
Export running time: 1,212

Solution

  • The old version of iReport uses an outdated version of POI. The library doesn't have the ability to truncate sheet names for excel. The solution is to rename you report (jrxml) to have a short filename.

    You can change the location of the backup file by going into Tools -> Options.