Advice on tracking down an error thrown by evaluateAllFormulaCells()

2015-11-24 Thread Tom Chiverton
I am trying to evaluate all the formula's in an Excel file. There are about a dozen sheets, with several tens of formula on each, all driven by a few input fields on the first sheet. This all works fine in Excel 365 itself. However, when I try and run it via the latest POI, evaluateAllFormulaCells

Re: Advice on tracking down an error thrown by evaluateAllFormulaCells()

2015-11-24 Thread Nick Burch
On Tue, 24 Nov 2015, Tom Chiverton wrote: I am trying to evaluate all the formula's in an Excel file. There are about a dozen sheets, with several tens of formula on each, all driven by a few input fields on the first sheet. This all works fine in Excel 365 itself. However, when I try and run it

Re: Advice on tracking down an error thrown by evaluateAllFormulaCells()

2015-11-24 Thread Tom Chiverton
Great plan, and I can dump out the values as I go too. I have narrowed (at least one of the errors) down to formula's of the pattern below. I think it returns an exact match from the VLOOKUP if one exists, otherwise it takes the immediate before and after rows and looks it up via TREND. Is some o

Re: Advice on tracking down an error thrown by evaluateAllFormulaCells()

2015-11-24 Thread Tom Chiverton
It looks like TREND() is causing the error. The two lookups inside it run find by themselves through POI, so the SMALL/LARGE and COUNTIF must all be working too. I admit to not having seen this syntax of IF({1,0},... before. Is TREND not implemented, or could I try a different syntax for the look

Re: Advice on tracking down an error thrown by evaluateAllFormulaCells()

2015-11-24 Thread Tom Chiverton
So, TREND() isn't implemented. Why don't I get a NotImplementedException then ? I'll see if I can knock up a quick implementation to contribute. On 24 November 2015 at 13:43, Tom Chiverton wrote: > It looks like TREND() is causing the error. > > The two lookups inside it run find by themselves

Re: Advice on tracking down an error thrown by evaluateAllFormulaCells()

2015-11-24 Thread Nick Burch
On Tue, 24 Nov 2015, Tom Chiverton wrote: So, TREND() isn't implemented. Why don't I get a NotImplementedException then ? I'll see if I can knock up a quick implementation to contribute. POI only has some support for array functions, so I wonder if it's tripping up on that first? A trend f

Re: Advice on tracking down an error thrown by evaluateAllFormulaCells()

2015-11-24 Thread Tom Chiverton
On 24 November 2015 at 14:09, Nick Burch wrote: > > http://people.apache.org/~yegor/apachecon_us2010/Evaluation_Of_Excel_Formulas_In_POI.pptx > for information on how evaluation works, functions, ptgs etc, if it's new > to you It is new, but my Java skills are hopefully OK :-) Is there a full

Re: Advice on tracking down an error thrown by evaluateAllFormulaCells()

2015-11-24 Thread Tom Chiverton
OK, so I made a dummy implementation of TREND, I think, and cells that use either the 2 or 3 argument version now evaluate to 0 rather than throwing the unsupported exception. But cells that use the weird (to my eyes) IF({1,0}, construct still throw "Unexpected ptg class". So I am wondering if the

Re: Advice on tracking down an error thrown by evaluateAllFormulaCells()

2015-11-24 Thread Yegor Kozlov
The weird syntax like {1,0} indicate it is an array formula . Unfortunately POI does not support it and I don't know an easy workaround. The formula API is pluggable, but the formula parser API isn't, this is where the PTG exception is coming from: PTG stands for parsed token and POI cannot parse t

Re: Advice on tracking down an error thrown by evaluateAllFormulaCells()

2015-11-24 Thread Javen O'Neal
On Nov 24, 2015 5:57 AM, "Tom Chiverton" wrote: > So, TREND() isn't implemented. Why don't I get a NotImplementedException > then ? If it's silently failing rather than raising an exception (UnsupportedOperationException("Not Implemented")), then this is something else that should be fixed, regard

Re: Advice on tracking down an error thrown by evaluateAllFormulaCells()

2015-11-25 Thread Javen O'Neal
Nick Burch said: > See > http://people.apache.org/~yegor/apachecon_us2010/Evaluation_Of_Excel_Formulas_In_POI.pptx > for information on how evaluation works, functions, ptgs etc, if it's new to > you This presentation would have been helpful when I was first learning how POI parses formulas. I c

Re: Advice on tracking down an error thrown by evaluateAllFormulaCells()

2015-11-25 Thread Nick Burch
On Wed, 25 Nov 2015, Javen O'Neal wrote: Nick Burch said: See http://people.apache.org/~yegor/apachecon_us2010/Evaluation_Of_Excel_Formulas_In_POI.pptx for information on how evaluation works, functions, ptgs etc, if it's new to you This presentation would have been helpful when I was first l

Re: Advice on tracking down an error thrown by evaluateAllFormulaCells()

2015-11-25 Thread Javen O'Neal
people.apache.org is being decommissioned in March 2016, so if we do link to the ppt, the file will need to be moved and the link updated--more incentive for distributing the information across the POI website. On Wed, Nov 25, 2015 at 3:55 AM, Nick Burch wrote: > On Wed, 25 Nov 2015, Javen O'Neal

Re: Advice on tracking down an error thrown by evaluateAllFormulaCells()

2015-11-27 Thread Tom Chiverton
On 25 November 2015 at 12:55, Javen O'Neal wrote: > people.apache.org is being decommissioned in March 2016, so if we do > link to the ppt, the file will need to be moved and the link home.apache.org is available now as a replacement. -- Tom