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.
You can write a java Code
In JRXML , you can use the following expression in the textbox
Set "Is blank When null" property to true
Regards,
Ankush
Set the property
isBlankWhenNull
to true.<textField isBlankWhenNull="true">
I have the option (Blank when Null) checked for every field in the report and still seeing nulls on the fields. So, I used report expressions.
Since every report variable is a string, to check for null use:
You can set the textfield height as 1, set the Stretch with overflow flag as true and Blank when null as true so when field value is blank it will not leave blank space between.
In The Expression You are allowed to use the Java code.
So what You need to do is to check that the value of field is null if is then replace it with empty string.
If you are working in ecliple+jasper softReports you just fallow below steps 1.select field + rightclick and select showProperties option 2.click TextField select BlankWhenNull 3.Compile and Rebuild check it.