The client was creating a report in SQL Server Reporting Services
2019, and wanted to sort fields within the tablix that contained Null values.
Solution:
There are a number of methods to resolve this issue, but I found this method quite quick and easy to apply.
Then one can sort on the field by:
- In SQL Server Reporting services, add the Tablix/Matrix or List object to the canvas
- Add the required fields to the object
- Right click on the object
- Select the Properties option
- In the Properties dialog box, select the Sorting Tab - Add
- Press the [fx] button to the right of the Sort By text box
- Enter the expression for the field to be sorted on:
=IIF(IsNothing(Fields!Fieldname.Value), "NULL", "NOTNULL")
- Press the OK button
- Select the Sort direction
- Press the OK button
- Run the report
If you have any questions, leave us a comment below, or need any assistance, please do not hesitate to Contact Us |