Groups | Blog | Home
all groups > sql server reporting services > december 2004 >

sql server reporting services : Sort Columns



Jeff A. Stucker
12/14/2004 11:46:43 AM
You can handle it manually in a couple of different ways:

* Create 3 different versions of your report and jump between them by
clicking on the header row. (That's what I've done.)
* See if you can sort based on a report parameter passed in. You could
either pass your parameter to the data source or try to drive the table
sorting based on it.

--
Cheers,

'(' Jeff A. Stucker
\

Business Intelligence
www.criadvantage.com
--------------------------------------
[quoted text, click to view]

John Geddes
12/14/2004 3:41:47 PM
Is there a way to sort columns dynamically in a table? I have a drill
down table where I would like to give the users the ability to either
click on a button or a click on a column name to dynamically sort by a
specific column.

I used to have three separate tables, each sorted a different way, but I
want to do it all in one table.

Thanks.
Jeff A. Stucker
12/14/2004 4:33:26 PM
Try this format:

=Fields(Parameters!SortBy.Value).Value

The bang notation (!) is simply shorthand for the above.

If that doesn't work, you may be able to use IIF or a switch statement to
choose between sorting options.

--
Cheers,

'(' Jeff A. Stucker
\

Business Intelligence
www.criadvantage.com
--------------------------------------
[quoted text, click to view]

bradsy NO[at]SPAM Online.Microsoft.com (
12/14/2004 6:22:52 PM
This feature is not in the current version. Look for this in the upcoming
version shipping in SQL 2005.
--------------------
| From: "John Geddes" <john_g@alamode.com>
| Subject: Sort Columns
| Date: Tue, 14 Dec 2004 15:41:47 +0000
| X-Newsreader: NewsHound for Microsoft Outlook v2.0.0.31 (unicode)
| Mime-Version: 1.0
| Content-Transfer-Encoding: 8bit
| Content-Type: text/plain; charset=us-ascii; format=flowed
| Message-ID: <#78frNf4EHA.3380@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.sqlserver.reportingsvcs
| NNTP-Posting-Host: 66.210.173.203
| Lines: 1
| Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09
.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.reportingsvcs:37371
| X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
|
| Is there a way to sort columns dynamically in a table? I have a drill
| down table where I would like to give the users the ability to either
| click on a button or a click on a column name to dynamically sort by a
| specific column.
|
| I used to have three separate tables, each sorted a different way, but I
| want to do it all in one table.
|
| Thanks.
|
|
John Geddes
12/14/2004 8:34:57 PM
Great. I like both ideas. Maybe I can create a drop down list and pass
a field to sort. Great Idea!

I'll try it and let you know what I find.


[quoted text, click to view]

John Geddes
12/14/2004 9:00:18 PM
I tried to pass the variable, but I am struggling with building the
expression to use on the sort.

I have tried this, but it does not sort: "=Fields!" &
Parameters!SortBy.Value & ".value"

Any ideas. I am not yet real fluent in this syntax.


[quoted text, click to view]

John Geddes
12/15/2004 12:20:29 AM
Thanks Jeff. I got it to work, but I get errors on the web, but it
works fine on my local machine.

I put it in another post... but here is part of it...



I pass two parameters, qty and sortdate. As the formulas show below,
when they select qty and ascending, it uses sum(fields). When I pick
date, it does not use sum.

This will sort by the value in the sortby parameter. Used for sortdate
field in data.
=iif(Parameters!Direction.Value="Descending" AND
Parameters!SortBy.Value<>"quantity",Fields(Parameters!SortBy.Value).Value,0)

When I need to sort by the sum of the qty since it is grouped, I do
this....
=iif(Parameters!Direction.Value="Descending" AND
Parameters!SortBy.Value="quantity",sum(Fields(Parameters!SortBy.Value).Value),0)


As I said above, this works perfect in visual studio when I preview it.
Any Ideas?



--




John Geddes
HYPERLINK "mailto:jgeddes@email.uophx.edu"jgeddes@email.uophx.edu
HYPERLINK "mailto:John.R.Geddes@gmail.com"John.R.Geddes@gmail.com


[quoted text, click to view]


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
AddThis Social Bookmark Button