Created attachment 23435 [details] problem.xls I use following codes to read attached "problem.xls" Excel file, the Excel file contains 5 worksheets but HSSFWorkbook.getNumberOfSheets() output 1 only. And write the workbook out, it cannot be opened by MS Excel. -- FileInputStream fis = new FileInputStream("problem.xls"); POIFSFileSystem poifs = new POIFSFileSystem(fis); HSSFWorkbook wb = new HSSFWorkbook(poifs); System.out.println("wb.getNumberOfSheets() = " + wb.getNumberOfSheets()); FileOutputStream os = new FileOutputStream("problem.output.xls"); wb.write(os);
Created attachment 23436 [details] problem.output.xls
Looks like a regression introduced in r757520. If I comment out the line 229 then the number of sheets is 5 and the output is readable by Excel. The offending line: _psBlock.addLateHeaderFooter(rs.getNext()); Josh, please confirm the bug. Yegor
Since this bug is a blocker in our current project, is there any update on this bug? Thanks a lot.
Fixed in svn r773412 junit added It seems like this bug was evident in existing test samples, but the junits were not checking the number of sheets in those cases. This change is just another band-aid. The code is long overdue for refactoring the chart/user-view stuff into dedicated RecordAggregate sub-classes.
*** Bug 47199 has been marked as a duplicate of this bug. ***