You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Michael Perkonigg <mi...@liland.at> on 2007/01/15 14:52:44 UTC

functions with empty parameterlist not working?

Hello,

I'm new to POI and this mailing list.

I tried POI 3.0 and I ran into troubles using Excel functions like 
TODAY() with an empty parameter list.

It seems that in the FormulaParser class in Ident at the end of the 
method an empty parameter list is taken as a cell reference:

...
        } else {
            //this can be either a cell ref or a named range !!
            boolean cellRef = true ; //we should probably do it with reg 
exp??
            boolean boolLit = (name.equals("TRUE") || name.equals("FALSE"));
            if (boolLit) {
                tokens.add(new BoolPtg(name));
            } else if (cellRef) {
                tokens.add(new ReferencePtg(name));
            }else {
                //handle after named range is integrated!!
            }
        }
    }


This results in a formula string like:

TODAY(ATTR(semiVolatile))

which excepts:

java.lang.IllegalArgumentException: Invalid Formula cell reference: 
'SEMIVOLATILE'
    at org.apache.poi.hssf.util.CellReference.<init>(CellReference.java:47)


Actually it strikes me that this semiVolatile might be created much 
earlier and the Ident just assumes it must be a cell reference...


Is that a bug and is someone working at it or is there no hope for a 
solution soon?

Thanks in advance for any comments,
Mike

---------------------------------------------------------------------
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/