Changing data sorting and grouping
You can use one or multiple fields as a basis for sorting report data. You can also organize report data by grouping it according to a specific field(s). Grouping allows you to have your report data presented as collections that are related.
Sorting data
The instructions documented are for SQL Server 2016. Your steps may be different if you are using a different version of SQL Server. |
You can sort data by a single field or by multiple fields. When you sort using multiple fields, SSRS uses a hierarchical method to sort it. You can sort data first by one field and then by another field(s).
To sort report data by one or multiple fields, follow these steps.
-
Open your report in Report Builder.
-
Left-click on the needed Row Group and select Group Properties.
-
Click Sorting.
-
Click Add.
-
In the Sort by field, click the down arrow to display a list of available fields for the report.
-
Select the field you want to use as a basis to sort the data.
To add more sorting fields, repeat Steps 4 through 6. -
Under Order, select one of the following options:
-
A to Z to sort data in ascending order
-
Z to A to sort data in descending order
-
-
Click OK.
-
Click Run.
-
Save your changes to the report.
Note: Be sure you are saving the changes to the copy of the template.
Grouping data
The instructions documented are for SQL Server 2016. Your steps may be different if you are using a different version of SQL Server. |
To have your report data presented as collections that are related, use grouping.
To group data by a specific field:
-
Open your report in Report Builder.
-
Left-click on the needed Row Group and select Add Group > Parent Group.
The Tablix group window opens. -
In the Group by field, click the down arrow to display a list of available fields for the report.
-
Select the field you want to use as a basis to group the data.
-
If needed, select the Add group header or Add group footer check boxes.
-
Click OK.
When a field by which you want to group data is currently in your report, delete the current field to avoid duplication. -
Click Run.
-
Save your changes to the report.
Note: Be sure you are saving the changes to the copy of the template.