Sorting in SSRS

The Sorting In SSRS is similar to the SQL ORDER BY Clause. Sorting is useful to Sort the records as per the given Expression in Tablix properties and then Sorted data will display in the final SSRS Report. In this article, we will show you how to sort the data at the Table level (or tablix level) in SSRS with an example.

TIP: It is always better to apply SSRS Sorting at the Textbox level (Interactive Sorting) only because it allows the user to sort the records dynamically.

We are going to use the below-shown report to explain, Sorting the data at the Tablix level. Please refer to the Table Report article to understand the Shared Data Source and Dataset we used for this SSRS report. If you see the below screenshot, It was a standard report with Product Name, Sales Amount, Color, and Tax Amount columns.

Format Fonts and Background of a Textbox 8

If you see the above screenshot, it displays the data in an unsorted manner.

Sorting in SSRS example

To apply SSRS sorting, Select the Top Left Corner of the report, and Right-click on it to open a context menu. Please select the Tablix Properties.. option from it

Tablix Properties 1

Once we click on the Tablix Properties.. option, a new Tablix Properties window will open. Please select the Sorting tab.

Click on the Add button will display the below properties

  • Sort by: It will allow you to select the available Column from the Dataset. Or we can create our own Expression by clicking the fx button. For instance, If you want to sort the data by Product Name, then select that column name.
  • Order: By default, A to Z will be selected as the Order type. You can change it as per your requirement. A to Z means Ascending Order and Z to A means Descending Order

In this SSRS Sorting example, we are going to Sort the records by [English Product Name] in the Ascending Order. So, please select the [English Product Name] as Sort By Expression and A to Z as Order.

Select the Sort By Column 3

Click the OK button to finish configuring Sorting at Tablix Level in SSRS. Let us Preview the Report

Sorting Table Report Preview 5

If you observe the above screenshot, data is sorted by the Product Name in the Ascending Order.

Let us add one more Sorting option at the Tablix level, for better understanding. Here, We are going to Sort the data by [Sales Amount] in Descending Order and then sort by [English Product Name] in Ascending Order.

SSRS Sort Table by Multiple Columns 6

TIP: If you want to delete the unnecessary Sorting Options, Please select the Sort Condition. Next, click on the Delete button.

Click the OK button to finish Applying Sorting at Tablix Level in SSRS. Let us Preview the Report

Sort by Multiple Columns Preview 7

If you observe the above image, Data is Sorted by the Sales Amount in Descending order. Then sorted by English product in the Ascending order.