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 2010/06/17 18:11:06 UTC

DO NOT REPLY [Bug 49457] New: Exception while parsing SUM formula

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

           Summary: Exception while parsing SUM formula
           Product: POI
           Version: 3.6
          Platform: PC
        OS/Version: Windows Vista
            Status: NEW
          Severity: major
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: eduard.dudar@gmail.com


Exception fails when we try to write HSSF workbook:
"org.apache.poi.ss.formula.FormulaParseException: Parse error near char 7 ';'
in specified formula 'SUM(D19;D23)'. Expected ',' or ')'". When I made proposed
change and replaced 'SUM(D19;D23)' with 'SUM(D19,D23)' exception disappeared.
However, 'SUM(D19;D23)' is valid formula in Excel and 'SUM(D19,D23)' is not.

Complete stacktrace is here:
    org.apache.poi.ss.formula.FormulaParser.expected(FormulaParser.java:217)
    org.apache.poi.ss.formula.FormulaParser.Arguments(FormulaParser.java:1049)
    org.apache.poi.ss.formula.FormulaParser.function(FormulaParser.java:929)
   
org.apache.poi.ss.formula.FormulaParser.parseNonRange(FormulaParser.java:551)
   
org.apache.poi.ss.formula.FormulaParser.parseRangeable(FormulaParser.java:423)
   
org.apache.poi.ss.formula.FormulaParser.parseRangeExpression(FormulaParser.java:266)
   
org.apache.poi.ss.formula.FormulaParser.parseSimpleFactor(FormulaParser.java:1112)
   
org.apache.poi.ss.formula.FormulaParser.percentFactor(FormulaParser.java:1072)
   
org.apache.poi.ss.formula.FormulaParser.powerFactor(FormulaParser.java:1059)
    org.apache.poi.ss.formula.FormulaParser.Term(FormulaParser.java:1410)
   
org.apache.poi.ss.formula.FormulaParser.additiveExpression(FormulaParser.java:1510)
   
org.apache.poi.ss.formula.FormulaParser.concatExpression(FormulaParser.java:1494)
   
org.apache.poi.ss.formula.FormulaParser.comparisonExpression(FormulaParser.java:1451)
   
org.apache.poi.ss.formula.FormulaParser.unionExpression(FormulaParser.java:1431)
    org.apache.poi.ss.formula.FormulaParser.parse(FormulaParser.java:1552)
    org.apache.poi.ss.formula.FormulaParser.parse(FormulaParser.java:174)
   
org.apache.poi.hssf.model.HSSFFormulaParser.parse(HSSFFormulaParser.java:72)
    org.apache.poi.hssf.usermodel.HSSFCell.setCellFormula(HSSFCell.java:588)

-- 
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 49457] Exception while parsing SUM formula

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

Josh Micich <jo...@gildedtree.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #1 from Josh Micich <jo...@gildedtree.com> 2010-06-17 13:50:53 EDT ---
Excel encodes formulas into a representation independent of the characters
visible in the human readable formula.  In some regions, Excel displays (and
parses) commas for argument delimiters, and in others, semicolons.  POI
currently does not support internationalisation for formula rendering/parsing,
and  effectively uses a default region of 'United States'.

The work around is simple - use comma instead of semicolon (as you mentioned
already).  Unfortunately, there will be small differences between the way POI
and Excel render/parse formulas in your region.

Contributions are always welcome.  To fix this will involve changes to the
FormulaParser class.  You'd need to deal with more than just the argument
delimiter: the decimal separator, and array element delimiter are probably also
region specific.  I am not sure what other elements of Excel formulas are
region specific.

*** This bug has been marked as a duplicate of bug 45909 ***

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