https://bz.apache.org/bugzilla/show_bug.cgi?id=56859
Javen O'Neal <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |WONTFIX --- Comment #5 from Javen O'Neal <[email protected]> --- If you only ask POI to parse a formula into Ptg tokens, it can create tokens for the 2 user-defined functions. orm You could do a FormulaParser.parse(String formula, ...), search for XNamePtgs (externally defined names), then try to evaluate the formula and if an evaluation error occurs, attach the names of the UDFs to that error message. You could also write a Java function that is equivalent to the VBA code for user-defined functions so that POI could successfully evaluate a formula. Without either of these, POI formula evaluation will be like any other code: an exception will be thrown on the first error. The behavior after the first error occurs is likely to be dependent on the application: * exit immediately with a stack trace and a likely cause for the error * propagate #ERROR, #NAN, #NAME, etc tokens throughout the formula evaluation process (this is what Excel does) * continue with evaluation and accumulate subsequent errors (cascaded errors could make this list quite long, not to mention waste execution time or introduce infinite loops) There has been some discussion on the mailing list and bugzilla on what POI's behavior should be. Mainly, how closely should POI try to match Excel's behavior versus provide the least surprising API for programmers (simple example: POI uses 0-based indexing). That said, feel free to search through the POI user and dev mailing lists [1] and reopen the discussion. Hopefully one of the two methods, either parse before evaluating or registering Java UDFs, will meet your needs without any changes to POI. [1] https://poi.apache.org/mailinglists.html -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
