Jump to content
We've recently updated our Privacy Statement, available here ×

iReport cannot validate null value?


steven.cyc

Recommended Posts

Hi, I'm new to iReport, and working in the version of iReport 4.0.

I have a field expression to handle the null field as below:
 $F{Profit} == null ? "N/A": new DecimalFormat("#,##0.00").format($F{Profit}

the field is expected to display "N/A" if null value, but iReport cannot validate the null value, it displays EMPTY.
I have checked that the "Blank When Null" is enabled, so I have already unchecked it..
but the report diaply  "null" finally, not "N/A"

is it a bug of iReport ?    could you have any suggestion?
I'm using Groovy, because the standard of our project is using Groovy. 

Please Help..

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Check this report in your environment. In my case it's worked perfect (JR 4.8.0)

<?xml version="1.0" encoding="UTF-8"?> select 1.12 Profit, 'not null field' descr from dualunion all select null, 'null field' from dual PROFIT DESCR $F{PROFIT} == null ? "N/A" : new DecimalFormat("#,##0.00").format($F{PROFIT}) $F{DESCR}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...