On Wed, 12 Dec 2007, Lenny Wintfeld wrote:
From the http://poi.apache.org/hssf/eval.html web page, using the
HSSFFormulaEvaluator all seems simple. But I'm having trouble getting a
simple test program to run. I'm sure it must be cockpit error on my
part, but I just don't see what it is.
There was one crucial line missing from the docs. Fixed docs should be on
the site in an hour or so.
You need to tell the evaluator what row it's working on, with a call to
setCurrentRow(row)
// suppose your formula is in B3
CellReference cellReference = new CellReference("C5");
HSSFRow row = sheet.getRow(cellReference.getRow());
HSSFCell cell = row.getCell(cellReference.getCol());
// This was missing
evaluator.setCurrentRow(row)
if (cell!=null) {
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]