toddbrook Posted May 24, 2011 Share Posted May 24, 2011 is it possible to do this with a variable which can be referenced in the group header's print when expression?i have a number of reports which contain groups and when the reports contain data then everything displays fine.however, if a report contains no data i would like to be able to display just a summary message that says there is no data. it is easy enough to display such a message in a band that only displays when $V{REPORT_COUNT} == 0, but the header of the first group still appears which i don't want.i would like to have a variable that counts the number of records in a group and which can be used in the print when expression of a group header so that the header only appears when there are records in the group. is this possible? if so, how? i've trawled through many tutorials and forum threads but i can only find how to display the count in a text field in the header which is not what i want.thanks Link to comment Share on other sites More sharing options...
jpauze Posted May 24, 2011 Share Posted May 24, 2011 Double check, when you added the group there should be a variable created specific to the group which can be used in the same manner as you were with the $V{REPORT_COUNT}. I recall by default the variable name will be GROUPNAME_COUNT where GROUPNAME is the name of the group you created. Hope that helps. Link to comment Share on other sites More sharing options...
mdahlman Posted May 25, 2011 Share Posted May 25, 2011 toddbrook,For the case "if a report contains no data" you should be able to handle it easily by using the band "No Data" which exists for exactly that purpose.A Print When expression in a group header will indeed be harder because there is no way to set the evaluation time for the Print When expression as there is for a Text Field. It probably requires a scriptlet or other custom code to calculate the total ahead of time.Regards,Matt Link to comment Share on other sites More sharing options...
toddbrook Posted May 25, 2011 Author Share Posted May 25, 2011 MattThanks, the no data band will solve a number of the problems I was having. Must remember to look for the simplest solution next time.There are some other situations where it would be nice to be able to calculate a variable based on group totals and have the variable acessible in the group header. Is this something that could be done in a future release? ThanksAlex 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