You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2011/04/08 06:45:46 UTC

DO NOT REPLY [Bug 51041] New: A major problem with parsing formula

https://issues.apache.org/bugzilla/show_bug.cgi?id=51041

           Summary: A major problem with parsing formula
           Product: POI
           Version: 3.6-dev
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: liyt0915@gmail.com


HI, 
    I found a problem when i set a formula in a cell.
    I set some cell's value , and export it , like this.
    Cell A1 's value is int(1), cell B1's value is int(2), and a fomula in cell
C1 is "=sum(A1+B1)".
   When i export this excel file, i find the formula can't calculate right. It
shows "#VALUE!".

    Then i found something for this problem.
    In the last case, poi parsed the formula and the result of tokens was :
    1. RefPtg  ptgclass (Ptg.CLASS_REF)         A1
    2. RefPtg  ptgclass (Ptg.CLASS_REF)         B1
    3. AddPtg                                                 +
    4. FunVarPtg                                           SUM
    The excel show it can't work when doing the add action.
    And if i parsed the formula "=A1+B1", the result of tokens was :
    1. RefPtg  ptgclass (Ptg.CLASS_VALUE)    A1
    2. RefPtg  ptgclass (Ptg.CLASS_VALUE)    B1
    3. AddPtg                                                 +
    and it calculate right;

    so i guess maybe excel only can do add action when the two ptg's ptgclass
is Ptg.CLASS_VALUE.

    Sorry for my poor english.

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


DO NOT REPLY [Bug 51041] A major problem with parsing formula

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51041

Nick Burch <ni...@alfresco.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Nick Burch <ni...@alfresco.com> 2011-04-08 07:08:23 EDT ---
You are aware that you need to use the FormulaEvaluator to calculate the cached
formula value? That needs to be done after changing any formulas, and before
saving the file. Otherwise you'll get the behaviour you describe of #VALUE! in
excel, until you trigger the recalculation

Can you confirm if you're doing a formula evaluation?

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