0

I have designed a tabular report in SSRS which has columns "Student Name", "Quarter" and "Amount". Is is possible to sort the report output with "Student Name" in Ascending Order and then by "Amount" in Descending order?

Here a student will have multiple row entries like:

Student  Amount  
 Jack      63
 Jack      62
 Jack      44
 Jill      54
 Jill      52

Thanks in advance

user793468
  • 4,898
  • 23
  • 81
  • 126
  • Do it in your datalayer, in the database stored procedure directly, see my answer for more info. – JonH Apr 06 '12 at 19:20

4 Answers4

2

Two different ways to easily accomplish this:

  1. In your query. Query sorting is preserved unless you specifically override it in the report. So something like this will work at the end of your query.

    ORDER BY Student, Amount DESC
    
  2. On the Tablix: In Tablix Properties, use the Sorting pane to add multiple levels of sorting.

Jamie F
  • 23,189
  • 5
  • 61
  • 77
1

Just do it in your query

CREATE TABLE #test
(
 name varchar(10),
 amount int
)

INSERT INTO #test(name, amount) VALUES('Jack', 63)
INSERT INTO #test(name, amount) VALUES('Jack', 62)
INSERT INTO #test(name, amount) VALUES('Jack', 44)
INSERT INTO #test(name, amount) VALUES('Jill', 54)
INSERT INTO #test(name, amount) VALUES('Jill', 52)

SELECT * FROM #test ORDER BY name ASC, amount DESC

DROP TABLE #test

Here's a working model for you: http://sqlfiddle.com/#!3/3fad2/2

JonH
  • 32,732
  • 12
  • 87
  • 145
0

You can also go to properties of the textbox in the header of the column to sort and go to interactive sorting. This will give the users the ability to sort ASC or Desc by clicking on the column header.

dug
  • 1
0

Go to Tablix properties->select Sorting->chose your column and sorting methodology. That's it.

arunk
  • 1
  • 1