Bug 8933 - Cannot open xls file
Summary: Cannot open xls file
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 1.5
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-09 08:42 UTC by Chan Chi shing
Modified: 2004-11-16 19:05 UTC (History)
1 user (show)



Attachments
cannot open this xls (21.00 KB, application/octet-stream)
2002-05-10 03:53 UTC, Chan Chi shing
Details
This is the one that could open (21.00 KB, application/octet-stream)
2002-05-10 03:54 UTC, Chan Chi shing
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chan Chi shing 2002-05-09 08:42:14 UTC
I have exception when open an xls file.

The error only occurs for my "test.xls", it is ok for my "ok.xls".
Both of them are created by Excel 2000.

The only difference between text.xls and ok.xls at row#2 column I.
The cell value of the cell is "01/05 (Wed)"

I cannot attach my xls here, please advise if I could upload the problem xls.
Thanks


below is the code
----begin code---------
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.poifs.filesystem.*;
import java.io.*;
class abc {

public static void main(String args[])
throws Exception
{
POIFSFileSystem fs=new POIFSFileSystem(new FileInputStream("test.xls"));
//POIFSFileSystem fs=new POIFSFileSystem(new FileInputStream("ok.xls"));

HSSFWorkbook wb=new HSSFWorkbook(fs);

}

}
---end code-------------

below is the stack dump
---- begin dump-----
java.lang.reflect.InvocationTargetException: java.lang.IllegalArgumentExceptionp
        at org.apache.poi.util.BinaryTree.insertValue(BinaryTree.java:1395)
        at org.apache.poi.util.BinaryTree.put(BinaryTree.java:1580)
        at org.apache.poi.hssf.record.SSTRecord.processString(SSTRecord.java:10)
        at org.apache.poi.hssf.record.SSTRecord.manufactureStrings(SSTRecord.ja)
        at org.apache.poi.hssf.record.SSTRecord.fillFields(SSTRecord.java:818)
        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.SSTRecord.<init>(SSTRecord.java:161)
        at java.lang.reflect.Constructor.newInstance(Native Method)
        at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.)
        at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:)
        at abc.main(abc.java:12)
Exception in thread "main" org.apache.poi.hssf.record.RecordFormatException: Unl
        at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.)
        at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:)
        at abc.main(abc.java:12)
----end dump------
Comment 1 Chan Chi shing 2002-05-10 03:53:47 UTC
Created attachment 1830 [details]
cannot open this xls
Comment 2 Chan Chi shing 2002-05-10 03:54:55 UTC
Created attachment 1831 [details]
This is the one that could open
Comment 3 Glen Stampoultzis 2002-06-10 03:11:18 UTC
Fixed.  Please check.
Comment 4 Chan Chi shing 2002-06-11 01:49:19 UTC
It works. Thank You.