Report Designer

Data Grouping

One of the main tasks when rendering reports is grouping the data. Grouping can be used both for the logical separation of data rows and to make a report look better. Two bands are used to create grouped reports: the GroupHeader band and the GroupFooter band. The GroupHeader band is output in the beginning of each group.

Note:
Due to different version of component using, the image and user guide for Report Designer might have slightly different from the component using in Xin 365.

The GroupFooter band is output in the end of each group. The picture below shows how a report with grouping may look:

Grouping in Report

Grouping Conditions

To create a report with grouping it is necessary to define a condition by which the records can be grouped. This condition will be used to divide the data rows into suitable groups, and is set using the Condition property of the Group Header band. You must define a condition for every group, otherwise no grouping will take place in the rendered report. You can set the condition by writing an Expression or choosing a Data Column.

Grouping Condition

GroupHeader Band

The Group header is created using the GroupHeader band, the basic band for rendering reports that use grouping. It is impossible to generate grouped reports without using a GroupHeader band. The Group Header band is output once at the beginning of each group and typically contains components that display header information such as a group name, date, grouping condition, etc. To create groups within a report you must specify a grouping condition using the Group Header band designer or the Condition property of the band. The Header band is always output before the Group Header band, regardless of where bands may be positioned on a page in the designer.

Group Header Band

When rendering a report the report generator binds the group header to the specified Data band. The Group Header band is positioned on a page before the Data band that outputs data rows. The Group Header band always belongs to a specific Data band, usually the first Data band positioned under the Group Header band.

You must have a Data band to be able to render grouped reports because data rows are output using this band and because those data rows are the basis of the grouping in the report. In addition you can specify the sorting of rows in the Data band which will affect the order in which the groups are rendered.

GroupFooter Band

The Group Footer band is commonly used to generate a group footer which is placed after the Data band bound to the group and typically contains components that output summary information relating to the group content. Every Group Footer band belongs to the Group Header band associated with it, and will not be output if there is no associated Group Header band. The Group Footer band is always output before the Footer band regardless of where bands may be positioned on a page:

Group Footer Band

The Group Footer band is used to output information specific to each group. For example, if you want to output the number of rows in a group, it is enough to put a text component on the Group Footer band and assign it the following expression:

Data Sorting in Group

When creating reports, you can sort both the data in a group and the groups themselves. It is important to note that the report writer automatically sorts rows of data before grouping. The default sorting is in ascending order (from A to Z).

Sorting can be performed in the following directions:

Column Description
Ascending The data is displayed in ascending order, from smallest to largest for numeric values and in alphabetical order from A to Z for text values.
Descending The data is displayed in descending order, from largest to smallest for numeric values and in reverse alphabetical order from Z to A for text values.
None The data will be displayed in the order they appear in the data source. If the data is already grouped and sorted before being transferred to the report, then there is no need to further group and sort it. Setting the sort direction to None, in this case, can reduce the time it takes to generate the report when dealing with large amounts of data.

Next topic: Data Sorting
Previous topic: Text Formatting


Need help?
Connect with us


New to Xin 365?
Sign up today