Interactive sorting can be used to enable a user to toggle between ascending and descending order for rows in a table or for rows and columns in a matrix.
In Bold Report Designer, you can configure interactive sorting for cells of a table or matrix using the User Sort property listed in tablix cell properties. At runtime, this will add sort buttons in the row or column headers and groups of the tablix data region. The user can then choose which column to sort by.
To achieve interactive sorting:
- Sort Expression: Choose what to sort in this field. Available fields in the assigned data set will be listed in the Sort Expression field. Select the expression containing the value of the field on which you want to perform sorting.
- Sort Expression Scope: Choose the scope to which to apply the sort. Available details and row and column grouping in the data region will be listed in the Sort Expression Scope field:
- To enable interactive sorting in the Details Row, choose details group.
- To enable interactive sorting in the Grouping Column, choose the row or column group.
- Sort Target: Choose what to sort by. Select the grouping level or data region within the report to sort.
Note: By default, sorting will be applied to the current scope. You can optionally choose a different scope in the Sort Expression Scope and Sort Target fields.
In this blog, we will explain how to configure the user sort property to a table data region in Bold Report Designer.
Add interactive sorting to table
In the below report design, the table data region has detail rows with no groups. You can download the report design from here: InitialDesign.zip
The data set query used in this report runs against an Adventure Works database.
Configure the User Sort property:
- In the table report item, select the text box in the column header to which you want to add an interactive sort button, and then open the Properties panel.
- Under the User Sort property, choose the data set field that corresponds to the column for which you are defining a sort action in the Sort Expression drop-down list. For example, I choose product category field.
- Choose the Details group in the Sort Expression Scope drop-down list.
To verify the sort action, preview the report. You can see the interactive sort icon is enabled in the Product Category column header.
If you click on the sort icon, the report will display sorted data.
Similarly, you can add sort buttons to other columns.
I hope this blog provided a clear idea on how to configure interactive sorting in an RDL report using the Bold Report Designer. To explore further, go through our sample reports and Bold Reports documentation. I have also attached the generated .rdl file for further reference.
If you have any questions, please post them in the comments section. You can also contact us through our contact page or, if you already have an account, you can log in to submit your support question.
Bold Reports now comes with a 15-day free trial with no credit card information required. We welcome you to start a free trial and experience Bold Reports for yourself. Give it a try and let us know what you think!