Bug 15343 - POI cannot read Gnumeric files
Summary: POI cannot read Gnumeric files
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 1.0.2
Hardware: Other Linux
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL: http://www.gnumeric.org
Depends on:
Reported: 2002-12-13 02:12 UTC by Guenter Wolf
Modified: 2012-06-20 14:29 UTC (History)
1 user (show)

Excel spreadsheet created with Gnumeric (14.00 KB, application/octet-stream)
2002-12-13 02:15 UTC, Guenter Wolf

Note You need to log in before you can comment on or make changes to this bug.
Description Guenter Wolf 2002-12-13 02:12:31 UTC
Jakarta POI cannot read Excel spreadsheet that were created by Gnumeric 
I don’t know if I should report this problem at Gnumeric or at POI.

Version information:
Gnumeric version 1.05 running under Linux
Jakarta POI 1.5.1

1.) Under Linux create with Gnumeric a spreadsheet like this:
col1	col2	col3
a	1	x
b	2	y
c	3	z
and save it in Excel format as gnumeric1.xls.

2.) Try to load the spreadsheets gnumeric1.xls with the example POIExample.java
The problem is that HSSFWorkbook calls createDocumentInputStream with a hard 
coded parameter "Workbook".
But Gnumeric creates Excel95 files, i.e. correct would be "Book".
java.io.FileNotFoundException: no such entry: "Workbook"
        at org.apache.poi.poifs.filesystem.DirectoryNode.getEntry
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>
        at POIExample.main(POIExample.java:83)

3.) Try to  load the spredsheet gnumeric1.xls with the example EventExample.java
Here you have a chance to call explicitely poifs.createDocumentInputStream
( "Book").
However the call factory.processEvents(req, din) fails.
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
        at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
        at org.apache.poi.hssf.record.RecordFactory.createRecord
        at org.apache.poi.hssf.eventmodel.HSSFEventFactory.processEvents
        at EventExample.main(EventExample.java:133)
Caused by: java.lang.ArrayIndexOutOfBoundsException
        at org.apache.poi.util.LittleEndian.getNumber(LittleEndian.java:537)
        at org.apache.poi.util.LittleEndian.getInt(LittleEndian.java:148)
        at org.apache.poi.hssf.record.BOFRecord.fillFields(BOFRecord.java:169)
        at org.apache.poi.hssf.record.Record.fillFields(Record.java:142)
        at org.apache.poi.hssf.record.Record.<init>(Record.java:104)
        at org.apache.poi.hssf.record.BOFRecord.<init>(BOFRecord.java:134)
        ... 7 more
org.apache.poi.hssf.record.RecordFormatException: Unable to construct record 
instance, the following exception 

occured: null
        at org.apache.poi.hssf.record.RecordFactory.createRecord
        at org.apache.poi.hssf.eventmodel.HSSFEventFactory.processEvents
        at EventExample.main(EventExample.java:133)
Exception in thread "main"
Comment 1 Guenter Wolf 2002-12-13 02:15:45 UTC
Created attachment 4152 [details]
Excel spreadsheet created with Gnumeric
Comment 2 Andy Oliver 2002-12-13 03:17:02 UTC
Gnumeric creates Excel 95 worksheets.  HSSF is for Excel 97+.
Comment 3 Guenter Wolf 2002-12-13 03:50:49 UTC
I have created a feature request at Gnumeric
Comment 4 Mark B 2012-06-20 14:29:01 UTC
Can you please attach an example file that POI cannot open?