2001 JI Open Discussion Posted August 17, 2006 Share Posted August 17, 2006 By: Yong Wang - wymz failed to fill a report with report variable 2002-12-10 08:47Hi, I am have problem filling any report that has a variable reset at group level and the field type is BigDecimal and the calc type is average: ... <field name="WHOLESALE_PRICE" class="java.math.BigDecimal" /> ... <variable name="WHOLESALE_PRICE_null_Average" class="java.math.BigDecimal" resetType="Report" calculation="Average"> <variableExpression>$F{WHOLESALE_PRICE}</variableExpression> </variable> ... During the fill, the exception thrown at the following code in JRCalculator (around line 310) where it tries to type cast the count variable (internal REPORT_COUNT, of Integer type) to BigDecimal countValue: case JRVariable.CALCULATION_AVERAGE : { if (variable.getValueClass().equals(java.math.BigDecimal.class)) { BigDecimal countValue = (BigDecimal)((JRFillVariable)variable.getCountVariable()).getValue(); BigDecimal sumValue = (BigDecimal)((JRFillVariable)variable.getSumVariable()).getValue(); BigDecimal newValue = sumValue.divide(countValue, BigDecimal.ROUND_HALF_UP); Any help would be appreciated. By: Teodor Danciu - teodord RE: failed to fill a report with report variable 2002-12-11 08:50 Hi, There is a patch for this in the "Patches" area. It will be part of the next release. Thank you, Teodor By: Yong Wang - wymz RE: failed to fill a report with report variable 2002-12-18 12:52Teodor, I posted another related problem in the bug area. pls take a look. thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now