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 2008/03/14 19:09:04 UTC

DO NOT REPLY [Bug 44606] [patch] Setting string value for formula cell yields ClassCastException

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ClassCastException          |[patch] Setting string value
                   |                            |for formula cell yields
                   |                            |ClassCastException




--- Comment #2 from Josh Micich <jo...@gildedtree.com>  2008-03-14 11:09:04 PST ---
I took a look at the code+spreadsheet you attached.  The latest POI fails well
before the ClassCastException.  This is because since 3.0, support for parsing
percent formula token was added, but percent evaluation has not been done yet. 
>From what I recall, in 3.0 the formula parser would just *stop* upon finding
any unknown char.  That's why you don't *crash* on '%'. If you check the
evaluated values, you should find that they're out by a factor of 100.

After I hacked a quick fix for PercentPtg, I could see your ClassCastException
error.  I have attached a patch to fix just this error.  (The percent
evaluation stuff will come a bit later).

If you don't care about the actual results from HSSFFormulaEvaluator, you can
just apply this patch to your 3.0 version of the code to get up and running. 
Otherwise you'll have to wait for PercentEval to be added to the svn trunk
before you'll have a version of POI that can handle your supplied example code.


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