Jump to content

Variable is displayed as null but corresponding Field displays correctly


slsolomon

Recommended Posts

Hello,

I have a field, $F{TRANSFER_DATE} defined as BigDecimal. The value in my database row is 1339381600. When I insert the field in my report, it displays correctly.

I also have a variable transferDateBigDecimal, also defined as BigDecimal, whose variable expression is defined as $F{TRANSFER_DATE}. When I insert the variable $V{transferDateBigDecimal} in my report, it displays as null.

The report language is Groovy. Using iReport 3.7.5. Database is H2 in server mode.

Any ideas?

Thanks

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Hi,

I don't know why is not showing the value of your field but why are you creating a variable that has the same value as the field? The aim of variables is to do some calculation with your fields but if you want to show the value of the field itself, just add the field in the report. I really don't understand what are you trying to do.

Regards.

Link to comment
Share on other sites

Well, yes, I am ultimately trying to do some processing on the field, in this case, convert it to Long, multiply by 1000L, then convert it to Date. I found that this processing resulted in null, so I did something very simple: simply set the value of the variable to the field. And the variable is still null.

So the problem remains: a variable whose value is a BigDecimal field is null. Again, using iReport 3.7.5 and H2.

I went back to my database and modified the table so that the field value is Long, and now I can successfully convert it to a Date object. So I believe the problem with BigDecimal is an iReport bug.

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...