irnewbie Posted June 30, 2011 Share Posted June 30, 2011 HiI 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.ThanksIRNewbie Link to comment Share on other sites More sharing options...
irnewbie Posted June 30, 2011 Author Share Posted June 30, 2011 HiDoes 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 More sharing options...
despec Posted June 30, 2011 Share Posted June 30, 2011 It's null within the header because the query hasn't been processed at that point. I'm not certain if this will work, but try changing the evaluation time for that variable from "Now" to "Report". David Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now