Hello Vijayakumar,

Currently there is no officially supported way of tracing formula
dependencies with POI but internally there is quite a lot of logic in
place for dealing with these issues.  Before you attack this problem
however, you should establish exactly what it is that you are trying
to find out.  For any given formula cell, POI can help you determine
the cell references either (a) apparently used or (b) actually
resolved during evaluation.  These (a and b) can be different and you
should understand why. (Many functions like IF, INDEX, INDIRECT
typically have differences between apparent references used versus
actual references used.  In general the presence of error values can
cut short the evaluation of just about any operator or function.)  If
there are differences between (a) and (b) for your case, then it is
likely that neither is exactly what you want.  You can write code to
make your own custom hybrid of (a) and (b), but your solution will
probably be incomplete (many cases not supported).

For (a) you can probably get good use out of
HSSFEvaluationWorkbook.getFormulaTokens(EvaluationCell).
For (b) it might be best to implement IEvaluationListener and pass
that to WorkbookEvaluator

As mentioned above, these solutions involve using POI classes marked
as 'for internal use only' which means that you cannot rely on your
code working properly against future versions of POI.  However, if you
are able to contribute your solution (and it has a simple API that is
likely to be useful to other POI users) it can become part of POI and
you won't have to worry about future support.


regards,
Josh

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to