I have a field in my jasper report which has a expression value like
$F{address_street1}+" "+$F{address_street2}+ " " +$F{address_state} + " "+$F{address_country}+ " "+$F{address_zip}
My problem is that if any of the fields in here is null I get the null value between other things like
101 Main St****null****ILUnited States12345
Notice the highlighted null. Is there any way I can avoid that?
I have tried checking the null value for a particular field in it using boolean expression and replacing it with blank, but that doesn't seem to work.
If the "Blank when null" is checked and its contains static text inside the text field the database fields ($F{}) will return null (if the field has no value).
The best way to format in jasper report is to use the pattern attribute on the textField tag. This will keep correct class (Number), when exporting to for example excel, excel can identify it as number and will also apply same pattern.
Set the property isBlankWhenNull
to true.
<textField isBlankWhenNull="true">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With