Crystal Reports & SQL Reporting Services Training Consultants
Account Log in:
Username:
Password:
Do your homework and know your facts, but remember it's passion that persuades
 
Institute of IT Trainers - Freelance Trainer of the Year 2006 & 2009
Liverpool Business Connect Member
  Maximum Impact Solutions Limited - Reporting Solutions, Creating Answers
Reporting Solutions - Creating Answers, Crystal Reports, Dashboarding (Xcelsius) & SQL Reporting Services

The Maximum Impact Solutions Blog Feed ME!!!!

13
April

How Do I Add Multiple Sorts to a Tablix Object in SQL Report Builder 2008?

I was contacted by a client, using SQL Server Report Builder 2008, enquirying "How does one add multiple sorts to a Tablix object?"


To add a sort to a Tablix object

  1. Right click on Detail Row of the tablix object

  2. Select the Tablix Properties... menu option

  3. In the Tablix Properties dialog box, select the Sorting Option

  4. Select the required field(s)  and sort order

  5. Press the OK button

This is fine if the report is being sorted by only one field.

The problem is that when multiple fields are used to sort a tablix object, it only sorts on the first data field.

In this case there are 2 options

  • Sort the data in the datasource, using the ORDER BY clause

  • Sort the data using grouping in the Tablix object

To add multiple fields sorts to a Tablix object
  1. Right click on Detail Row of the tablix object

  2. Select Add Group - Parent Group

  3. Add the required 1st field to sort by

  4. Deselect the Add Group Header and Add Group Footer options

  5. Right click on Detail Row of the tablix object

  6. Select the Add Group - Child Group

  7. Add the required 2nd field to sort by

  8. Deselect the Add Group Header and Add Group Footer options

  9. Repeat steps 5 - 8, to add additional fields to sort by

  10. Right click on the first Group Column

  11. Select Delete Column

  12. In the Delete Columns dialog box select the Delete Columns Only options

  13. Press the OK button

  14. Repeat steps 10 - 13, for all the other groups of the Tablix

  15. Run the report

Note:

For the best report processing performance, it is better to use the ORDER BY clause within the SQL statement

MAKE A COMMENT

Name *

Email Address *

Comment *