poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Micich <josh.mic...@gmail.com>
Subject Re: External Data References
Date Fri, 19 Mar 2010 22:06:31 GMT
Hello Steve,

>From what I can tell you are on the right track.  I guess you are
using NameXPtg._nameNumber to locate the correct item from
LinkTable.ExternalBookBlock._externalNameRecords.  These records not
only have the name of the defined-name name but also the the formula
tokens, however I think you are more correct in resolving the formula
via the other workbook (as the code above seems to suggest).

I am intrigued by the -2 sheet index values.  I wonder if '-2' is a
special distinguished value besides '-1', or whether the negated value
(+2) has some relevance.

This code might need changing:
refWorkbookEvaluator.evaluateNameFormula(ptgs,this);
There might be a problem with the scope of the
OperationEvaluationContext (second param, 'this').  It is supposed to
know the location of the cell under evaluation.  Cell evaluation is
recursive and every time a new cell is visited, a new OEC is created.
I'm still not sure whether a separate context should be required when
evaluating defined names.  At the moment, there doesn't seem to be an
issue because POI only supports evaluation of names that directly
translate into cell references.  If POI were to support more complex
name evaluation this might change.  In any case, it seems to be odd to
be passing an OEC from a calling workbook into the other workbook
evaluator.  Maybe this is a sign of redundancy in the design.  Perhaps
we could experiment a little with formulas involving defined names to
get a better feel of where the evaluation context boundaries seem to
be.

hope this helps,
Josh

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


Mime
View raw message