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

sql server reporting services : Can I sort on fields by in paramters


Jack Nielsen
9/12/2005 10:36:39 PM
I need to sort a report in 3 ways 2 fields and one expression.

When i add a field to a parameter it says the following:

"Fields cannot be used in report parameter expressions"

The expression I need to sort on is this
=(sum(Fields!p1beløb.Value) - sum(Fields!p2beløb.Value)) /
(0.001+sum(Fields!p1beløb.Value))

It works if I use this as sort on the group item, but I need to choose
between 3 kinds.

How can I sort the report if I can't use fields to tell how I want it
sorted
???

Jack




--
Jeg beskyttes af den gratis SPAMfighter til privatbrugere.
Den har indtil videre sparet mig for at få 45071 spam-mails.
Betalende brugere får ikke denne besked i deres e-mails.
Hent gratis SPAMfighter her: www.spamfighter.dk

Jack Nielsen
9/13/2005 12:00:00 AM
I think this is somehow difficult, doesn't other designers need to sort the
result differently based upon fields ?

Jack

"Wayne Snyder" <wayne.nospam.snyder@mariner-usa.com> skrev i en meddelelse
news:eZbuG$DuFHA.3740@TK2MSFTNGP14.phx.gbl...
[quoted text, click to view]

Wayne Snyder
9/13/2005 4:42:58 AM
Create a function in the code area which accepts the Parameter ( 1,2 or 3 )
and all of the fields you wish to sort on..
The function should use the parameter in a case/switch statement to choose
which value to return. In one case it should return the value of the
expression you mentioned.

In the sort column pu
=Code.GetSort(Parameters!SortVal.Value,.......)

Hope this helps...

--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)

I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org

[quoted text, click to view]

AddThis Social Bookmark Button