Regis,

I have POI 2.5.x and apparently it works for drop downs.
(drop downs: columns with data validation set to "list")

If your sheets are simple tables, and you are working on windows,
you may want to consider using ODBC drivers to read your excel files
as DB tables using JDBC as an alternative to POI.


HTH,
~ amol










-----Original Message-----
From: CABARET Regis [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 03, 2005 6:34 AM
To: [email protected]
Subject: POI crashes when opening Excel file with drop-down list


 Hi,

I am using POI to convert an Excel file containing multiple worksheets into
an ASCII file that is
to be loaded into a database.
The Excel file has one worksheet with two pull-down lists for the user to
select some parameters.
If I try to open this workbook with POI HSSF, it throws an exception:
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
sorImpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
torAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
        at
org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:224
)
        at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:16
0)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:163)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:210)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:191)
        at
utils.TransformExcelWkToAscii.<init>(TransformExcelWkToAscii.java:25)
        at test.main(test.java:6)
Caused by: java.lang.IllegalArgumentException: Illegal length
        at
org.apache.poi.util.StringUtil.getFromUnicodeHigh(StringUtil.java:76)
        at
org.apache.poi.hssf.record.FontRecord.fillFields(FontRecord.java:135)
        at org.apache.poi.hssf.record.Record.fillFields(Record.java:90)
        at org.apache.poi.hssf.record.Record.<init>(Record.java:55)
        at org.apache.poi.hssf.record.FontRecord.<init>(FontRecord.java:88)
        ... 11 more
Exception in thread "main" org.apache.poi.hssf.record.RecordFormatException:
Unable to construct
record instance, the following exception occured: nul
l
        at
org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:237
)
        at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:16
0)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:163)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:210)
        at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:191)
        at
utils.TransformExcelWkToAscii.<init>(TransformExcelWkToAscii.java:25)
        at test.main(test.java:6)

However, if I remove the drop down lists, then it works fine.
Any suggestion to solve this problem would be welcomed.

Thanks.

Regis

=====

 



________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/

Reply via email to