iReport print when expression
Posted on July 23, 2012 at 11:56am
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
Joined: Jul 23 2012 - 11:50am
Last seen: 8 years 1 month ago
Posted on July 23, 2012 at 1:08pm
Try this on the field you want to only print conditionally ... In the "Print When Expression"
new Boolean($F{myField} != null)
Joined: Nov 18 2007 - 11:14am
Last seen: 8 years 5 months ago
Posted on July 25, 2012 at 6:15am
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)
Joined: Jul 23 2012 - 11:50am
Last seen: 8 years 1 month ago
Posted on April 11, 2013 at 12:17am
Hi,
For doing this, you can try in the "print when expression" : !$F{Myfield}.isEmpty()
Joined: Apr 11 2013 - 12:15am
Last seen: 8 years 5 days ago
@Djo_hn
Your answer was perfect and solved my issue also.
Thanks