Jump to content

failed to fill a report with report variable


Recommended Posts

By: Yong Wang - wymz

failed to fill a report with report variable

2002-12-10 08:47

Hi, 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:52

Teodor, I posted another related problem in the bug area. pls take a look. thanks.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...