ActiveReports 13
Add Grouping in Section Reports
ActiveReports 13 > ActiveReports User Guide > How To > Section Report How To > Work with Data in Section Reports > Add Grouping in Section Reports

In a section report, you can set grouping on a field or a field expression. Use the following steps to understand grouping in a section report.

These steps assume that you have already added a Section Report (xml-based) or Section Report (code based) template and connected it to a data source. See Adding an ActiveReport to a Project for further information.

  1. Right-click the design surface of a report and select Insert, then Group Header/Footer. Group Header and Footer sections appear immediately above and below the detail section.
  2. With the GroupHeader section selected, go to the Properties window and set the DataField to a field on which you want to group the data. For example, Country from Customers table in the NWind database.
    Note: You can also set a field expression in the DataField property. For example, =Country + City.
  3. Drag and drop the grouping field onto the GroupHeader section to see the grouping field while previewing the report.
  4. Drag and drop data fields onto the detail section. All the data placed inside the detail section gets grouped according to grouping field.
  5. Preview the report to see the result.

The following image shows a customer list grouped on the Country field.

Tip: In a section report, data is grouped in the order in which it is fetched in the raw form. Therefore, for best results, while setting the SQL query in your report data source, order the data by the grouping field. For example., SELECT * FROM Customers ORDER BY Country
See Also

Concepts