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

Problem referencing Variables in the Detail band


stephen.calder

Recommended Posts

I have a field of type float in my DB, let's call it X. I want to have two other user defined variables that do seperate math operations on that value show up in the Detail band, and do sums on them at the end of the report. 

in iReport, my Expression Editor looks like this for the original DB value:   $F{X}

My first user defined variable is named "test_var" and looks like this:  $F{X}.floatValue()*(1.15)

I want my third value, named "test_var_calc" to reference test_var like so: $V{test_var}.floatValue()*(1/0.75)

This looks like it should work, but while "test_var" does work correctly, "test_var_calc" is always null. 

Also, any attempt to sum() the values in "test_var" or "test_var_calc" also always return null. 

 

Any help is appreciated.

 

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Thanks for that! It is similar, but I couldn't get mine to work despite looking at your example. As I'm pressed for time I just modified the query to do the calculations in SQL (which while messy, got things working right).

 

I will come back to this and try to get it working how I want, as I'm sure I'll bump into it again later, and if I sort it out I'll bump this thread.

 

Thanks again!

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