The Grouping feature of ActiveReports allows to group the data (keep them together) in a report. All you need is to set the Group Header section's DataField property to the field on which you want to group the report. When you run the report, it renders the group header, followed by all the related instances of detail section, and then the group footer (considering non-multiple grouping scenario). You can set one or more than one nested groups in a report, known as multiple grouping. You can find more information about this in Grouping Data topic in our documentation site. There is a scenario where the content within the group is spanned over multiple pages; and end user needs some indication about this. It is similar to have a label with text like 'continued...', to show that the group data is continued on to the next page. Attached image shows how a report looks like after the implementation:
The implementation of this feature is very simple and has been explained in points below:
- Place a Textbox on the GroupHeader and use it to count the pages for the group.
- Keep the Visible property of this Textbox as false since we are using it for calculation purpose only.
- Since we are using this textbox to keep count of total pages in the Group, set the following properties for it:
SummaryFunc:- Count SummaryGroup:- GroupHeader Name SummaryRunning:- Group SummaryType:- PageCount
- In addition to this, place a Label control on the GroupHeader with Text "Continued...".
- In the GroupHeader's BeforePrint event, check if the PageCount from the hidden textbox and if the count is more than one, then toggle the visibility for the Label with "Continued..." text to Visible.
I have attached the sample applications to showcase the complete implementation. In the attached samples, location of the Nwind database is set to C:\Nwind.mdb. Modify the connection string to reflect the location of the Nwind in your machine. ContinueOnGroup_C# ContinueOnGroup_VB.NET