You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2007/04/26 04:37:24 UTC

DO NOT REPLY [Bug 42256] New: - unkown grbit '16' error while reading excel file.

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

http://issues.apache.org/bugzilla/show_bug.cgi?id=42256

           Summary: unkown grbit '16'  error while reading excel file.
           Product: POI
           Version: 3.0-dev
          Platform: HP
        OS/Version: HP-UX
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: HSSF
        AssignedTo: poi-dev@jakarta.apache.org
        ReportedBy: sara_uppalapati@yahoo.com


Hi, I am trying to read an excel file that was modified on excel 2003. Getting 
below exceptions:

java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance
(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
        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)
        at ReadInvSheet.main(ReadInvSheet.java:47)
Caused by: org.apache.poi.hssf.record.RecordFormatException: Unknown grbit '16'
        at org.apache.poi.hssf.record.formula.ArrayPtg.readTokenValues
(ArrayPtg.java:98)
        at org.apache.poi.hssf.record.formula.Ptg.createParsedExpressionTokens
(Ptg.java:109)
        at org.apache.poi.hssf.record.NameRecord.fillFields(NameRecord.java:739)
        at org.apache.poi.hssf.record.Record.<init>(Record.java:55)
        at org.apache.poi.hssf.record.NameRecord.<init>(NameRecord.java:142)
        ... 10 more
Error in Reading : org.apache.poi.hssf.record.RecordFormatException: Unable to 
construct record instance, the following exception occured: null

Code snippet that is trying to read excel -
try
	    {
	      fs = new FileInputStream(fileToBeRead);
	      System.out.println(" file read" );
	      FI = new FileInputStream(propertyFile) ;
	      FW = new FileWriter(fileToBeWritten);
	    }
	  catch(FileNotFoundException e)
	    {
	      throw new Exception(e);
	    }
	  catch(IOException e)
	    {
	      throw new Exception(e);
	    }
	  System.out.println("Before HSSFWorkbook Initiation");
	  HSSFWorkbook workbook = new HSSFWorkbook(fs);
	  System.out.println("After HSSFWorkbook Initiation");


Exception are right at initializing HSSFWorkbook() - HSSFWorkbook workbook = 
new HSSFWorkbook(fs);

We are using POI_3.0_Alpha.jar. I tried test with poi-3.0-rc3-20070402.jar and 
still have same error. 

I tried deleting all tabs in the excel file step by step and tried at last with 
no data also and I still have same error.
But when I try create empty excel on my machine(office 2000) and used it, 
program works fine.  

Could this be the issue with office 2003 compatibility? 

It is failing even with no data in the file that was created/updated on the 
machine which has office 2003.  Since no data and no array formulas in the 
excel file, control is still going to Ptg and ArrayPtg classes and calling 
readTokenValues(). 

I will attach the spread sheet that started causing issues. Thanks.

-- 
Configure bugmail: http://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: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/


DO NOT REPLY [Bug 42256] - unkown grbit '16' error while reading excel file.

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

http://issues.apache.org/bugzilla/show_bug.cgi?id=42256





------- Additional Comments From sara_uppalapati@yahoo.com  2007-04-25 19:48 -------
Created an attachment (id=20048)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=20048&action=view)
Excel file that caused issues even after deleting all data

After deleting all data from the attached spreadsheet also caused same errors.
Attached the same file. I tried save as of type excel 97-2000 also with no
luck.

-- 
Configure bugmail: http://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: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/