Search code examples
jasper-reports

JasperReports: default value instead of 'null'


Is there any way to set a default value to a field in a report? I have a lot of String fields in a report and would like them to display "0,00" when they're null.


Solution

  • Supposing the field name is "value", in the "Text Field Expression", write:

    ($F{value} != null) ? $F{value} : "0.00"