You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Chris McCann <te...@gmail.com> on 2011/06/11 08:33:05 UTC

"Not implemented" exception for SUMIF function in xlsx file

I'm having trouble evaluating the SUMIF function in a *.xlsx file.  It's
throwing a "not implemented yet" exception but I can't figure out what's not
implemented.

Is this function supported?  If not, is there a list somewhere of what
functions are supported for evaluation?  The Sumif class has an evaluate()
method so I'm a bit confused.

FWIW, the function call in Excel is:

=SUMIF($AI$3:$JN$3,C$36,$AI40:$JN40)

Cell C36 is simply 1.

Is there an issue with one of the arguments to the function relative to what
POI can handle?

Here's the stacktrace.

Exception in thread "main" java.lang.RuntimeException: Not implemented yet
    at
org.apache.poi.xssf.usermodel.XSSFEvaluationWorkbook.getNameXPtg(XSSFEvaluationWorkbook.java:105)
    at
org.apache.poi.ss.formula.FormulaParser.function(FormulaParser.java:916)
    at
org.apache.poi.ss.formula.FormulaParser.parseNonRange(FormulaParser.java:556)
    at
org.apache.poi.ss.formula.FormulaParser.parseRangeable(FormulaParser.java:427)
    at
org.apache.poi.ss.formula.FormulaParser.parseRangeExpression(FormulaParser.java:266)
    at
org.apache.poi.ss.formula.FormulaParser.parseSimpleFactor(FormulaParser.java:1117)
    at
org.apache.poi.ss.formula.FormulaParser.percentFactor(FormulaParser.java:1077)
    at
org.apache.poi.ss.formula.FormulaParser.powerFactor(FormulaParser.java:1064)
    at org.apache.poi.ss.formula.FormulaParser.Term(FormulaParser.java:1424)
    at
org.apache.poi.ss.formula.FormulaParser.additiveExpression(FormulaParser.java:1524)
    at
org.apache.poi.ss.formula.FormulaParser.concatExpression(FormulaParser.java:1508)
    at
org.apache.poi.ss.formula.FormulaParser.comparisonExpression(FormulaParser.java:1465)
    at
org.apache.poi.ss.formula.FormulaParser.unionExpression(FormulaParser.java:1445)
    at
org.apache.poi.ss.formula.FormulaParser.parse(FormulaParser.java:1566)
    at org.apache.poi.ss.formula.FormulaParser.parse(FormulaParser.java:174)
    at
org.apache.poi.xssf.usermodel.XSSFCell.convertSharedFormula(XSSFCell.java:394)
    at
org.apache.poi.xssf.usermodel.XSSFCell.getCellFormula(XSSFCell.java:368)
    at
org.apache.poi.xssf.usermodel.XSSFEvaluationWorkbook.getFormulaTokens(XSSFEvaluationWorkbook.java:146)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:277)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateReference(WorkbookEvaluator.java:618)
    at
org.apache.poi.ss.formula.SheetRefEvaluator.getEvalForCell(SheetRefEvaluator.java:47)
    at
org.apache.poi.ss.formula.LazyRefEval.getInnerValueEval(LazyRefEval.java:44)
    at
org.apache.poi.hssf.record.formula.eval.OperandResolver.getSingleValue(OperandResolver.java:62)
    at
org.apache.poi.hssf.record.formula.eval.RelationalOperationEval.evaluate(RelationalOperationEval.java:64)
    at
org.apache.poi.hssf.record.formula.functions.Fixed2ArgFunction.evaluate(Fixed2ArgFunction.java:33)
    at
org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:119)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:456)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:279)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateReference(WorkbookEvaluator.java:618)
    at
org.apache.poi.ss.formula.SheetRefEvaluator.getEvalForCell(SheetRefEvaluator.java:47)
    at
org.apache.poi.ss.formula.LazyAreaEval.getRelativeValue(LazyAreaEval.java:51)
    at
org.apache.poi.hssf.record.formula.functions.Sumif.accumulate(Sumif.java:95)
    at
org.apache.poi.hssf.record.formula.functions.Sumif.sumMatchingCells(Sumif.java:83)
    at
org.apache.poi.hssf.record.formula.functions.Sumif.eval(Sumif.java:72)
    at
org.apache.poi.hssf.record.formula.functions.Sumif.evaluate(Sumif.java:65)
    at
org.apache.poi.hssf.record.formula.functions.Var2or3ArgFunction.evaluate(Var2or3ArgFunction.java:36)
    at
org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:132)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:456)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:279)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateReference(WorkbookEvaluator.java:618)
    at
org.apache.poi.ss.formula.SheetRefEvaluator.getEvalForCell(SheetRefEvaluator.java:47)
    at
org.apache.poi.ss.formula.LazyAreaEval.getRelativeValue(LazyAreaEval.java:51)
    at
org.apache.poi.hssf.record.formula.eval.AreaEvalBase.getValue(AreaEvalBase.java:109)
    at
org.apache.poi.hssf.record.formula.functions.MultiOperandNumericFunction.collectValues(MultiOperandNumericFunction.java:143)
    at
org.apache.poi.hssf.record.formula.functions.MultiOperandNumericFunction.getNumberArray(MultiOperandNumericFunction.java:127)
    at
org.apache.poi.hssf.record.formula.functions.MultiOperandNumericFunction.evaluate(MultiOperandNumericFunction.java:89)
    at
org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:132)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:456)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:279)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateReference(WorkbookEvaluator.java:618)
    at
org.apache.poi.ss.formula.SheetRefEvaluator.getEvalForCell(SheetRefEvaluator.java:47)
    at
org.apache.poi.ss.formula.LazyRefEval.getInnerValueEval(LazyRefEval.java:44)
    at
org.apache.poi.hssf.record.formula.eval.OperandResolver.getSingleValue(OperandResolver.java:62)
    at
org.apache.poi.hssf.record.formula.eval.TwoOperandNumericOperation.singleOperandEvaluate(TwoOperandNumericOperation.java:29)
    at
org.apache.poi.hssf.record.formula.eval.TwoOperandNumericOperation.evaluate(TwoOperandNumericOperation.java:35)
    at
org.apache.poi.hssf.record.formula.functions.Fixed2ArgFunction.evaluate(Fixed2ArgFunction.java:33)
    at
org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:119)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:456)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:279)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateReference(WorkbookEvaluator.java:618)
    at
org.apache.poi.ss.formula.SheetRefEvaluator.getEvalForCell(SheetRefEvaluator.java:47)
    at
org.apache.poi.ss.formula.LazyAreaEval.getRelativeValue(LazyAreaEval.java:51)
    at
org.apache.poi.hssf.record.formula.eval.AreaEvalBase.getValue(AreaEvalBase.java:109)
    at
org.apache.poi.hssf.record.formula.functions.MultiOperandNumericFunction.collectValues(MultiOperandNumericFunction.java:143)
    at
org.apache.poi.hssf.record.formula.functions.MultiOperandNumericFunction.getNumberArray(MultiOperandNumericFunction.java:127)
    at
org.apache.poi.hssf.record.formula.functions.MultiOperandNumericFunction.evaluate(MultiOperandNumericFunction.java:89)
    at
org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:132)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:456)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:279)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluate(WorkbookEvaluator.java:221)
    at
org.apache.poi.xssf.usermodel.XSSFFormulaEvaluator.evaluateFormulaCellValue(XSSFFormulaEvaluator.java:257)
    at
org.apache.poi.xssf.usermodel.XSSFFormulaEvaluator.evaluate(XSSFFormulaEvaluator.java:116)
    at PoiExcel.main(PoiExcel.java:29)

In order to try to debug into the method that's failing I need the source
for the XSSFEvaluationWorkbook class but it doesn't appear to be in the
poi-3.7 source download.  Is that source available somewhere?

I found a fork of the code at
http://code.google.com/p/zkpoi/source/browse/branches/zkpoi/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFEvaluationWorkbook.java?r=46and
the getNameXPtg() method simply throws the not implemented exception.
I'm guessing this is true in the Apache POI code as well.

If anyone can help me understand the issue here I'd appreciate it!

Cheers,

Chris

Re: "Not implemented" exception for SUMIF function in xlsx file

Posted by Yegor Kozlov <ye...@dinom.ru>.
>
> Not being familiar with the code base in terms of how unimplemented
> functions are handled it seems to me it should be possible to at least
> surface the name of the requested, unimplemented function in the exception
> message.  That would be tremendously helpful for debugging.
>

You want to look at the cause of the exception, i.e.
exception.getCause() will return you a more detailed message.
Print the full stack trace and you will see something like this:

org.apache.poi.ss.formula.eval.NotImplementedException: Error
evaluating cell Sheet1!B1
	at org.apache.poi.ss.formula.WorkbookEvaluator.addExceptionInfo(WorkbookEvaluator.java:321)
	at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:288)
	at org.apache.poi.ss.formula.WorkbookEvaluator.evaluate(WorkbookEvaluator.java:221)
	at org.apache.poi.xssf.usermodel.XSSFFormulaEvaluator.evaluateFormulaCellValue(XSSFFormulaEvaluator.java:264)
	at org.apache.poi.xssf.usermodel.XSSFFormulaEvaluator.evaluate(XSSFFormulaEvaluator.java:117)
	at org.apache.poi.xssf.Scratchpad.test50244(Scratchpad.java:38)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at junit.framework.TestCase.runTest(TestCase.java:154)
	at junit.framework.TestCase.runBare(TestCase.java:127)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at junit.textui.TestRunner.doRun(TestRunner.java:116)
	at com.intellij.junit3.JUnit3IdeaTestRunner.doRun(JUnit3IdeaTestRunner.java:139)
	at junit.textui.TestRunner.doRun(TestRunner.java:109)
	at com.intellij.junit3.JUnit3IdeaTestRunner.startRunnerWithArgs(JUnit3IdeaTestRunner.java:52)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:199)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: org.apache.poi.ss.formula.eval.NotImplementedException: EOMONTH
	at org.apache.poi.ss.formula.atp.AnalysisToolPak$NotImplemented.evaluate(AnalysisToolPak.java:45)
	at org.apache.poi.ss.formula.UserDefinedFunction.evaluate(UserDefinedFunction.java:64)
	at org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:129)

Yegor

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: "Not implemented" exception for SUMIF function in xlsx file

Posted by Chris McCann <te...@gmail.com>.
Sure, I can do that.

On Sun, Jun 12, 2011 at 5:22 AM, Nick Burch <ni...@alfresco.com> wrote:

> On Sun, 12 Jun 2011, Chris McCann wrote:
>
>> Following up on this:  I changed the Mac Excel preference to use the
>> Windows 1900 base date and all is well with the POI date calculations now.
>>
>
> Great. Any chance you could create a new bug in bugzilla for this? If you
> could upload two very simple files, one with 1900 and one with 1904 dates,
> and a date, it's string value, the month function, and it's result string
> value? We can use that for a unit test when we fix the TODO.
>
> Nick
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>

Re: "Not implemented" exception for SUMIF function in xlsx file

Posted by Nick Burch <ni...@alfresco.com>.
On Sun, 12 Jun 2011, Chris McCann wrote:
> Following up on this:  I changed the Mac Excel preference to use the 
> Windows 1900 base date and all is well with the POI date calculations 
> now.

Great. Any chance you could create a new bug in bugzilla for this? If you 
could upload two very simple files, one with 1900 and one with 1904 dates, 
and a date, it's string value, the month function, and it's result string 
value? We can use that for a unit test when we fix the TODO.

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: "Not implemented" exception for SUMIF function in xlsx file

Posted by Chris McCann <te...@gmail.com>.
Following up on this:  I changed the Mac Excel preference to use the Windows
1900 base date and all is well with the POI date calculations now.

Should this be addressed somewhere in the code or the docs, or is it
already?

Cheers,

Chris

On Sat, Jun 11, 2011 at 11:44 PM, Chris McCann <te...@gmail.com>wrote:

> Yegor,
>
> I'll take a look at how the AnalysisToolPak functions are implemented to
> see if I can contribute.
>
> After I modified the spreadsheet to not use EOMONTH I was checking some
> other calculations and have come across a strange problem.
>
> Since I can't use EOMONTH I'm using this to get the first day of the next
> month.
>
> Assume A2 = 1/1/2011, then the function in B2 to get the first day of the
> next month is:
>
> B2:  =DATE(YEAR(A2), MONTH(A2)+1, 1)
>
> This works fine in Excel and, I thought, in POI.  But I noticed some
> formula values were not being returned correctly in POI, and after digging
> into it there seems to be an issue with the MONTH function.
>
> In Excel I get this:
>
> =MONTH(A2) => 1
>
> But POI says MONTH(A2) => 12.0.
>
> Say what?  And that explains why a function that checks to see if two dates
> are equal is failing when the dates should be equal, and the dependent
> formulas are not returning the correct values.
>
> The serial date value for "1/1/2011" is 39082.  If I use the DATE function
> above for B2 I get a serial number of 39083 and a date of 1/2/2011, which is
> quite wrong.
>
> Is there some trick to using MONTH and other date functions in Excel so
> that POI will evaluate them properly?
>
> I did look at the source for CalendarFieldFunction.java (I think that's
> what's handling MONTH), and I noticed a TODO about "fix 1900/1904 problem".
> I'm using a Mac, and the Excel docs do indicate that Mac and Windows systems
> use 1904 and 1900, respectively, for their serial dates.  Could this be the
> problem, or at least part of it?
>
> Cheers,
>
> Chris
>
>
> On Sat, Jun 11, 2011 at 11:23 PM, Yegor Kozlov <ye...@dinom.ru>wrote:
>
>> On Sun, Jun 12, 2011 at 8:28 AM, Chris McCann <te...@gmail.com>
>> wrote:
>> > Thanks, Nick.  Your response made me dig deeply into all of the
>> functions
>> > used in dependent cells.  I found that we were using the EOMONTH
>> function to
>> > calculate the first/last day of a month.  That function is part of the
>> > Analysis Toolpak, and I assume that's why it's not implemented.  Is
>> there a
>> > list of implemented functions somewhere in the docs?
>> >
>>
>> Mappings for the AnalysisToolpack are defined here:
>>
>> http://svn.apache.org/repos/asf/poi/trunk/src/java/org/apache/poi/ss/formula/atp/AnalysisToolPak.java
>>
>> At the moment POI implements only five ATP functions:
>>
>> ISEVEN
>> ISODD
>> MROUND
>> RANDBETWEEN
>> YEARFRAC
>>
>>
>> It should be easy to add support for EOMONTH, just follow the pattern:
>> create a sub-class of FreeRefFunction and register it in
>> AnalysisToolPak.java.
>>
>> Patches are welcome. Let me know if you need guidance.
>>
>> > Changing our EOMONTH for a different function that is supported made
>> > everything work, so that problem is solved.
>> >
>> > Not being familiar with the code base in terms of how unimplemented
>> > functions are handled it seems to me it should be possible to at least
>> > surface the name of the requested, unimplemented function in the
>> exception
>> > message.  That would be tremendously helpful for debugging.
>> >
>>
>> I'm going to look into the code and see if it is possible to propagate
>> function name into the exception message.
>>
>> Yegor
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
>> For additional commands, e-mail: user-help@poi.apache.org
>>
>>
>

Re: "Not implemented" exception for SUMIF function in xlsx file

Posted by Chris McCann <te...@gmail.com>.
Yegor,

I'll take a look at how the AnalysisToolPak functions are implemented to see
if I can contribute.

After I modified the spreadsheet to not use EOMONTH I was checking some
other calculations and have come across a strange problem.

Since I can't use EOMONTH I'm using this to get the first day of the next
month.

Assume A2 = 1/1/2011, then the function in B2 to get the first day of the
next month is:

B2:  =DATE(YEAR(A2), MONTH(A2)+1, 1)

This works fine in Excel and, I thought, in POI.  But I noticed some formula
values were not being returned correctly in POI, and after digging into it
there seems to be an issue with the MONTH function.

In Excel I get this:

=MONTH(A2) => 1

But POI says MONTH(A2) => 12.0.

Say what?  And that explains why a function that checks to see if two dates
are equal is failing when the dates should be equal, and the dependent
formulas are not returning the correct values.

The serial date value for "1/1/2011" is 39082.  If I use the DATE function
above for B2 I get a serial number of 39083 and a date of 1/2/2011, which is
quite wrong.

Is there some trick to using MONTH and other date functions in Excel so that
POI will evaluate them properly?

I did look at the source for CalendarFieldFunction.java (I think that's
what's handling MONTH), and I noticed a TODO about "fix 1900/1904 problem".
I'm using a Mac, and the Excel docs do indicate that Mac and Windows systems
use 1904 and 1900, respectively, for their serial dates.  Could this be the
problem, or at least part of it?

Cheers,

Chris

On Sat, Jun 11, 2011 at 11:23 PM, Yegor Kozlov <ye...@dinom.ru>wrote:

> On Sun, Jun 12, 2011 at 8:28 AM, Chris McCann <te...@gmail.com>
> wrote:
> > Thanks, Nick.  Your response made me dig deeply into all of the functions
> > used in dependent cells.  I found that we were using the EOMONTH function
> to
> > calculate the first/last day of a month.  That function is part of the
> > Analysis Toolpak, and I assume that's why it's not implemented.  Is there
> a
> > list of implemented functions somewhere in the docs?
> >
>
> Mappings for the AnalysisToolpack are defined here:
>
> http://svn.apache.org/repos/asf/poi/trunk/src/java/org/apache/poi/ss/formula/atp/AnalysisToolPak.java
>
> At the moment POI implements only five ATP functions:
>
> ISEVEN
> ISODD
> MROUND
> RANDBETWEEN
> YEARFRAC
>
>
> It should be easy to add support for EOMONTH, just follow the pattern:
> create a sub-class of FreeRefFunction and register it in
> AnalysisToolPak.java.
>
> Patches are welcome. Let me know if you need guidance.
>
> > Changing our EOMONTH for a different function that is supported made
> > everything work, so that problem is solved.
> >
> > Not being familiar with the code base in terms of how unimplemented
> > functions are handled it seems to me it should be possible to at least
> > surface the name of the requested, unimplemented function in the
> exception
> > message.  That would be tremendously helpful for debugging.
> >
>
> I'm going to look into the code and see if it is possible to propagate
> function name into the exception message.
>
> Yegor
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>

Re: "Not implemented" exception for SUMIF function in xlsx file

Posted by Yegor Kozlov <ye...@dinom.ru>.
On Sun, Jun 12, 2011 at 8:28 AM, Chris McCann <te...@gmail.com> wrote:
> Thanks, Nick.  Your response made me dig deeply into all of the functions
> used in dependent cells.  I found that we were using the EOMONTH function to
> calculate the first/last day of a month.  That function is part of the
> Analysis Toolpak, and I assume that's why it's not implemented.  Is there a
> list of implemented functions somewhere in the docs?
>

Mappings for the AnalysisToolpack are defined here:
http://svn.apache.org/repos/asf/poi/trunk/src/java/org/apache/poi/ss/formula/atp/AnalysisToolPak.java

At the moment POI implements only five ATP functions:

ISEVEN
ISODD
MROUND
RANDBETWEEN
YEARFRAC


It should be easy to add support for EOMONTH, just follow the pattern:
create a sub-class of FreeRefFunction and register it in
AnalysisToolPak.java.

Patches are welcome. Let me know if you need guidance.

> Changing our EOMONTH for a different function that is supported made
> everything work, so that problem is solved.
>
> Not being familiar with the code base in terms of how unimplemented
> functions are handled it seems to me it should be possible to at least
> surface the name of the requested, unimplemented function in the exception
> message.  That would be tremendously helpful for debugging.
>

I'm going to look into the code and see if it is possible to propagate
function name into the exception message.

Yegor

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: "Not implemented" exception for SUMIF function in xlsx file

Posted by Chris McCann <te...@gmail.com>.
Thanks, Nick.  Your response made me dig deeply into all of the functions
used in dependent cells.  I found that we were using the EOMONTH function to
calculate the first/last day of a month.  That function is part of the
Analysis Toolpak, and I assume that's why it's not implemented.  Is there a
list of implemented functions somewhere in the docs?

Changing our EOMONTH for a different function that is supported made
everything work, so that problem is solved.

Not being familiar with the code base in terms of how unimplemented
functions are handled it seems to me it should be possible to at least
surface the name of the requested, unimplemented function in the exception
message.  That would be tremendously helpful for debugging.

Cheers,

Chris

On Sat, Jun 11, 2011 at 9:47 AM, Nick Burch <ni...@alfresco.com> wrote:

> On Fri, 10 Jun 2011, Chris McCann wrote:
>
>> I'm having trouble evaluating the SUMIF function in a *.xlsx file.  It's
>> throwing a "not implemented yet" exception but I can't figure out what's
>> not
>> implemented.
>>
>
> getNameXPtg is the bit that isn't there. It's generally only needed for
> sheet and named range bits, so I don't know why you're hitting it on your
> formula
>
>
>  FWIW, the function call in Excel is:
>>
>> =SUMIF($AI$3:$JN$3,C$36,$AI40:$JN40)
>>
>
> Can you try a simpler formula and see where it breaks? You might also want
> to look at the stack trace and try to spot why it thinks it needs a NameXPtg
> (there might be a bug in the parser for example)
>
> (Ideally someone would get around to implementing the equivalent function
> for xssf, but that may be more work than you want to put in at the moment!)
>
>
>  In order to try to debug into the method that's failing I need the source
>> for the XSSFEvaluationWorkbook class but it doesn't appear to be in the
>> poi-3.7 source download.  Is that source available somewhere?
>>
>
> It'll be in the source download, in the /src/ooxml/java/ directory
>
> Nick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>

Re: "Not implemented" exception for SUMIF function in xlsx file

Posted by Nick Burch <ni...@alfresco.com>.
On Fri, 10 Jun 2011, Chris McCann wrote:
> I'm having trouble evaluating the SUMIF function in a *.xlsx file.  It's
> throwing a "not implemented yet" exception but I can't figure out what's not
> implemented.

getNameXPtg is the bit that isn't there. It's generally only needed for 
sheet and named range bits, so I don't know why you're hitting it on your 
formula

> FWIW, the function call in Excel is:
>
> =SUMIF($AI$3:$JN$3,C$36,$AI40:$JN40)

Can you try a simpler formula and see where it breaks? You might also want 
to look at the stack trace and try to spot why it thinks it needs a 
NameXPtg (there might be a bug in the parser for example)

(Ideally someone would get around to implementing the equivalent function 
for xssf, but that may be more work than you want to put in at the 
moment!)

> In order to try to debug into the method that's failing I need the 
> source for the XSSFEvaluationWorkbook class but it doesn't appear to be 
> in the poi-3.7 source download.  Is that source available somewhere?

It'll be in the source download, in the /src/ooxml/java/ directory

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org