poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 46643] Formula parser should encode explicit range operator with tMemFunc
Date Tue, 03 Feb 2009 00:26:56 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=46643





--- Comment #11 from Josh Micich <josh@gildedtree.com>  2009-02-02 16:26:55 PST ---
(In reply to comment #10)
> I used the formula reference:
> cell.setCellFormula("SUM(InventoryDetails!D2:InventoryDetails!D3)");

Cool.  So the other, hypothetical bug doesn't exist :)

> I am new to POI and need to fix this in a production environment on the
> 3.2.FINAL release.  Could you show me how to do this or ppoint me in the right
> direct (classes to look at, etc)?

You have three main choices:

(1) Work Around
If it's easy enough for you to change that line of code to
cell.setCellFormula("SUM(D2:D3)");
then you can use POI 3.2-FINAL as-is, since the problem only occurs with the
explicit range operator (which is more or less ':' with a complex RHS)

(2) Wait for the next POI release
Next: 'nightly build' tomorrow, 'betawithin a week or so, or 'final' in perhaps
a month.

(3) Patch your local 3.2
The fix was quite small (details below), but I am not 100% sure if all of the
other stuff needed to make this work are present in version 3.2.  For example I
think bug 44675 is important (it *is* present in 3.1-beta2).  There could be
other important fixes things that I am not remembering.


The critical change was on line 347 of this file:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/FormulaParser.java?annotate=729028&pathrev=740146
Delete one line and add three:
-                return new ParseNode(RangePtg.instance, children);
+                ParseNode result = new ParseNode(RangePtg.instance, children);
+                MemFuncPtg memFuncPtg = new
MemFuncPtg(result.getEncodedSize());
+                return new ParseNode(memFuncPtg, result);


Of course in 3.2 the line number is different (326): 
http://svn.apache.org/viewvc/poi/tags/REL_3_2_FINAL/src/java/org/apache/poi/ss/formula/FormulaParser.java?annotate=703641







http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/FormulaParser.java?r1=740146&r2=740145&pathrev=740146


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


Mime
View raw message