version:poi-3.7-20101029.jar I made the book with five sheets. The following error goes out when the first sheet remove and output. // remove first sheet workbook.removeSheetAt( 0); It is normally output if it doesn't remove sheet. (attached file). Exception in thread "main" org.bbreak.excella.core.exception.ExportException: java.lang.IllegalArgumentException: calculated end index (15392) is out of allowable range (15388..15390) at org.bbreak.excella.reports.exporter.XLSExporter.output(XLSExporter.java:77) at org.bbreak.excella.reports.exporter.ExcelExporter.output(ExcelExporter.java:79) at org.bbreak.excella.reports.exporter.ReportBookExporter.export(ReportBookExporter.java:96) at org.bbreak.excella.reports.processor.ReportProcessor.processBook(ReportProcessor.java:215) at org.bbreak.excella.reports.processor.ReportProcessor.process(ReportProcessor.java:110) at org.bbreak.excella.reports.samples.InvoiceReporter.main(InvoiceReporter.java:132) Caused by: java.lang.IllegalArgumentException: calculated end index (15392) is out of allowable range (15388..15390) at org.apache.poi.util.LittleEndianByteArrayOutputStream.<init>(LittleEndianByteArrayOutputStream.java:41) at org.apache.poi.hssf.record.StandardRecord.serialize(StandardRecord.java:38) at org.apache.poi.hssf.usermodel.HSSFWorkbook$SheetRecordCollector.serialize(HSSFWorkbook.java:1209) at org.apache.poi.hssf.usermodel.HSSFWorkbook.getBytes(HSSFWorkbook.java:1258) at org.apache.poi.hssf.usermodel.HSSFWorkbook.write(HSSFWorkbook.java:1158) at org.bbreak.excella.core.util.PoiUtil.writeBook(PoiUtil.java:355) at org.bbreak.excella.reports.exporter.XLSExporter.output(XLSExporter.java:75) ... 5 more
Created attachment 26315 [details] normally output file
Please post the complete Java code to reproduce the problem. If your code requires an .xls template then upload it too. Yegor
Created attachment 26319 [details] error java code
Created attachment 26320 [details] error xls file
The error java code and xls file attached.
This bug does not reproduce in version 3.6.
We finally found the culprit here in the way the setSheetOrder() was handled internally. It missed to update some internal structures thus confusing the calculation of the serialization-sizes. Should be fixed in 3.10 in r1516313.