Jump to content

First conditional row


rodrigo_43

Recommended Posts

Hi all, I am writing reports right now with Jaspersoft Studio and have the following issue:

I need to do a Summary at the bottom of report which shall include FIRST and LAST row's specific field, but only when that row meets specific criteria.

This is what i've done so far: My variable $V{OPENING_CASH} should bring the opening balance amount of the first row which has "Bonus" as account_type, I've set the expression to the following:

 $F{account_type}.equals("Bonus") ? $F{opening_balance} : null , but this brings null if condition is not met in first row(as expected lol) what I need is to bring the first row which is not actually null, but I don't know how to actually do this. 

 

Any ideas? Thanks in advance

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Have you tried seting the variable as below:

Name: OPENING_CASH

Value Class Name: java.lang.String

Calculation: No Calculation Function

Expression:($V{OPENING_CASH}== null && $F{opening_balance} != null) ? $F{opening_balance} : $V{OPENING_CASH}

Reset type: Report

Link to comment
Share on other sites

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