I've totally fixed this bug!!!!!
What can I do to share my fix???

Simone Caldon ha scritto:
Hello everybody,

When I try to read some Excel file with a cell that contains a formula with the
#N/D word, HSSFWorkbook can't istanciates the workbook...Is there any
work-around solution for this kind of problem? I want to ignore this type of
error and continue to work with other cells... Tnx for support!
This is the stacktrace:

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java:213) at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.java:149) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:183) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:230) at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:211)

The problem is in createRecord(RecordInputStream in) function of RecordFactory
Class (package org.apache.hssf.record)
When the flow encounter the cell with formula that contains #N/D string,
Constructor returns sid=0x06 that corresponds to FormulaRecord object.
FormulaRecord fillFields(RecordInputStream in) method try to parse the formula with: field_8_parsed_expr = Ptg.createParsedExpressionTokens(field_7_expression_len, in);

Ptg.createPtg was called and in some case of the switch was generated an
exception, I haven't verified what id was detected...I'll try to work again in
this days..

I've also posted a bug in bugzilla with an attachment:
http://issues.apache.org/bugzilla/show_bug.cgi?id=40786

Thanx for support!


Chiacchiera con i tuoi amici in tempo reale! http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com
---------------------------------------------------------------------
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/




Chiacchiera con i tuoi amici in tempo reale! http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com
---------------------------------------------------------------------
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