poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 45865] New: Formula Parser doesn't handle external file references
Date Tue, 23 Sep 2008 12:59:32 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=45865

           Summary: Formula Parser doesn't handle external file references
           Product: POI
           Version: unspecified
          Platform: PC
               URL: http://www.nabble.com/IndexBound-Exception-by-
                    FormulaCell-Evaluation-td19622168.html
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: pierre.lavignotte@gmail.com


When a formula contains a reference to an external file/sheet/cell, the parser
ignores the external file reference and only parses the sheet/cell reference.

If the index of the original sheet is greater than the maximum index of the
sheets of the current workbook, an IndexOutOfBoundException occurs.

Exemple :
WorkbookA has two sheets named Sheet1 & Sheet2
WorkbookB has only one sheet named Sheet1

In workbook B :
The formula '[WorkbookA]Sheet1!$A$1' will be correctly parsed but will point to
cell A1 in WorkbookB.
the formula '[WorkbookA]Sheet2!$A$1' will fail to parse because it will point
to the second sheet of WorkbookB, wich doesn't exist.

If WorkbookB contains 2 formulas :
A2 = '[WorkbookA]Sheet1!$A$1'
A3 = '[WorkbookA]Sheet2!$A$1'

Debuging the A2 cell record shows :
Ptg(0)=org.apache.poi.hssf.record.formula.Ref3DPtg [sheetIx=2 ! $A$1]
So it makes evaluation to fail also.

The attached sample shows a formula that evaluate in the wrong workbook.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message