2006 IR Open Dicussion Posted August 27, 2006 Share Posted August 27, 2006 By: Paul Stanton - wanto Excel: Sheet name cannot be blank... 2006-06-21 19:19I'm getting this exception when i export one of my reports to excel. 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:175) at org.apache.poi.hssf.model.Workbook.setSheetName(Workbook.java:458) at org.apache.poi.hssf.model.Workbook.setSheetName(Workbook.java:452) at org.apache.poi.hssf.usermodel.HSSFWorkbook.createSheet(HSSFWorkbook.java:369) at net.sf.jasperreports.engine.export.JRXlsExporter.createSheet(JRXlsExporter.java:126) i'm guessing the sheet name is too long or contains invalid chars (pretty obvious) but where is the sheet name gleaned from and how do i configure it? i'll post if i find a solution. thanks. By: Paul Stanton - wanto RE: Excel: Sheet name cannot be blank... 2006-06-21 19:54jasper uses the report file name for the sheet name. a long file name will cause this error. here is my solution: exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE); exporter.setParameter(JRXlsExporterParameter.SHEET_NAMES, new String[]{sheetName}); making sure that sheetName is less than 32 chars long. 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