https://issues.apache.org/bugzilla/show_bug.cgi?id=46953

           Summary: Incorrect HSSFWorkbook.getNumberOfSheets() and corrupt
                    Excel file
           Product: POI
           Version: 3.5-dev
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: major
          Priority: P2
         Component: HSSF
        AssignedTo: [email protected]
        ReportedBy: [email protected]


Created an attachment (id=23435)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23435)
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);

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to