Search code examples
jasper-reports

Variable returns null at first row in report


I am using Jaspersoft Studio for building reports.

I have a variable which actually checks a column TODAY has null values of not. Expression of that value is

$F{TODAY} == null ? new BigDecimal(0.00) : $F{TODAY}

TODAY column has null values in my case for now.

The problem is first the expression above returns null for the first row and zero for the other rows. It should return 0 for every row since TODAY column is null

What can be the reason for that?


Solution

  • The problem is leaving "initial value expression" part empty. I added the same expression also to that field and it works fine now.