Groups | Blog | Home
all groups > sql server reporting services > july 2005 >

sql server reporting services : Order By Param


Amon Borland
7/12/2005 10:10:02 AM
Is there a way to have a report parameter for the selection of what field
the user wants a table to be grouped on? For instance, the parameter would
have 3 options, clientid, clientname, and clientcity. I want to be able to
select one of these and have the table group on this selection.

Or any generic ways or ideas on how to accomplish this?

Thanks!!!

Andy
8/2/2005 9:35:02 PM
I am looking for the same solution. I have a client that I have promised 10
reports to and they gave me a few but want sort capability on 5 different
fields. I could say that those are 5 different reports, but there should be
an easy way to list the fields in a drop down parameter and adjust the ORDER
BY based on this. Shouldn't there???

Thanks in advance.

ANDY

[quoted text, click to view]
William Byrd
8/3/2005 11:39:52 AM
can you pass the field to sort on into the report as a parameter and use a
CASE in your query to conditionally sort based on whatever you passed in as
a parameter?

Bill

[quoted text, click to view]

rob.farley NO[at]SPAM jeyes.co-dot-uk.no-spam.invalid
8/4/2005 1:10:06 AM
It seems all my replied are this..

Sorting is easy
DECLARE @sql as varchar(100)
SET @sql = 'SELECT * FROM blah WHERE blah = blah ORDER BY '
@paramete
EXEC sp_executesql @sq

Grouping on the other hand I don't think you can do dynamically
AddThis Social Bookmark Button