user793468
user793468

Reputation: 4976

sorting in SSRS

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

Upvotes: 0

Views: 1827

Answers (4)

arunk
arunk

Reputation: 1

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

Upvotes: 0

dug
dug

Reputation: 1

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.

Upvotes: 0

Jamie F
Jamie F

Reputation: 23809

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.

Upvotes: 2

JonH
JonH

Reputation: 33183

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

Upvotes: 1

Related Questions