DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<https://issues.apache.org/bugzilla/show_bug.cgi?id=44483>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

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

           Summary: create workbook throws
                    java.lang.IndexOutOfBoundsException with simple Excel
                    file
           Product: POI
           Version: 3.0-dev
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


Hello All,

Description
-----------

Creating a new HSSFWorkbook causes a Java Exception to be thrown and the
workbook not created.  The attached spreadsheet AVON.xls shows this behaviour -
it is a stripped down spreadsheet from a client ; I have stripped out almost all
data, worksheets, hidden worksheets, named ranges ... to leave this virtually
empty sheet.

Expected Behaviour
------------------

That the workbook is created correctly.

To replicate
------------
The following lines of code cause the exception to be thrown if the inFile is
the attached "AVON.xls"
 
  POIFSFileSystem fs = new POIFSFileSystem (new FileInputStream (inFile));
  wb = new HSSFWorkbook(fs);

The Exception is:

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.RangeCheck(ArrayList.java:547)
        at java.util.ArrayList.get(ArrayList.java:322)
        at org.apache.poi.util.IntMapper.get(IntMapper.java:81)
        at org.apache.poi.hssf.record.SSTRecord.getString(SSTRecord.java:195)
        at org.apache.poi.hssf.model.Workbook.getSSTString(Workbook.java:729)
        at
org.apache.poi.hssf.usermodel.HSSFRichTextString.<init>(HSSFRichTextString.java:57)
        at org.apache.poi.hssf.usermodel.HSSFCell.<init>(HSSFCell.java:202)
        at
org.apache.poi.hssf.usermodel.HSSFRow.createCellFromRecord(HSSFRow.java:193)
        at
org.apache.poi.hssf.usermodel.HSSFSheet.setPropertiesFromSheet(HSSFSheet.java:177)
        at org.apache.poi.hssf.usermodel.HSSFSheet.<init>(HSSFSheet.java:131)
        at 
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:226)
        at 
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:148)
        at ExcelParser2.createWorkBook(ExcelParser2.java:47)
        at ExcelParser2.main(ExcelParser2.java:330)

Workaround
----------

None that I'm aware of ...

Any ideas?

Cheers,

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

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to