iReport print when expression

0

 Hello All,

 

I have a field in my report that i want not to print if another field is null. I have tried the "isEmpty(true)" but to no avail. what expression would work for what I am trying to achomplish.

Thank you in Advance,

-Vlad

vmsteps's picture
Joined: Jul 23 2012 - 11:50am
Last seen: 6 years 2 months ago

@Djo_hn

Your answer was perfect and solved my issue also.

Thanks

nileshwarinovio16 - 2 years 5 months ago

3 Answers:

1

Try this on the field you want to only print conditionally ... In the "Print When Expression"

new Boolean($F{myField} != null)

 

cmatthews's picture
Joined: Nov 18 2007 - 11:14am
Last seen: 6 years 7 months ago
0
Thanks for the help cmatthews, I wasn't able to get that to work for the null field. Instead I created another column that would be zero if it is null so I have:

new Boolean($F{myField} != 0)
vmsteps's picture
Joined: Jul 23 2012 - 11:50am
Last seen: 6 years 2 months ago
1

Hi, 

For doing this, you can try in the "print when expression" :  !$F{Myfield}.isEmpty()

 

Djo_hn's picture
30
Joined: Apr 11 2013 - 12:15am
Last seen: 6 years 1 month ago
Feedback