Jump to content
JasperReports Library 7.0 is now available ×

Problem with <variableExpression>


Recommended Posts

By: Mike - liang_mike

Problem with <variableExpression>

2003-10-29 12:47

I have a variable and I want to increment it if the field, which is called "PaymentMethod", is equal to "PAC".

 

<field name="PaymentMethod" class="java.lang.String"/>

......................

<variable name="numPACContracts" class="java.lang.Integer" resetType="Group" resetGroup="ByGroup" calculation="System">

<variableExpression>($F{PaymentMethod}.equals("PAC"))?(new Integer($V{numPACContracts}.intValue() + 1)):($V{numPACContracts})</variableExpression>

<initialValueExpression>new Integer(0)</initialValueExpression>

</variable>

 

However, numPACContracts is always 0. I am pretty sure there is "PAC" in the datasource, so it shouldn't be the datasource's problem.

 

Anyone have any idea why it is always the initial value?

 

I also have tried ($F{PaymentMethod}=="PAC"), but still doesn't work

 

Thank you

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