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

Displaying Variable Sum in Text Heading


irnewbie

Recommended Posts

Hi

I have a field that is summed and a resultant variable that holds the sum value. I can display this value when putting the variable anywhere on the page but when I try to include it in a msg expression within the a text field heading it displays null.

How can I have it display the value in the text msg. A sample of the heading is below;

msg("Total for ({0} to {1}) {2}",
                    $P{startDate}==null ? "No Start Date"  :  new SimpleDateFormat("dd/MM/yyyy", Locale.UK).format($P{startDate}),
                    $P{endDate}==null ? "No End Date" :   new SimpleDateFormat("dd/MM/yyyy", Locale.UK).format($P{endDate}),
                    $V{total})

The total variable in bold shows null.

Thanks

IRNewbie

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

Does anyone have any ideas how to do this, i've had 4 views and no replies? I do not understand how to display this variable value and cannot get to the bottom of why it is displaying null in the msg but is showing value when placed on report display?

The variable is a long type, do I need to do anything like pass it to a parameter or similar, if so how do I do that?

IRNewbie

 

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