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

sql server reporting services : Sorting based on parameters


rs_newbie
8/18/2005 2:28:31 PM
I want to give the end user a choice of sorting by one of 5 different fields.

In Crystal Reports I:
1. Created a parameter (SortField) with 5 default values. (A, C, N, S, Z)
2. Created a formula (Sort) with
If {?SortField} startswith "C" then {BKCMACCT.BKCM_ACCT_CITY}
Else
If {?SortField} startswith "N" then {BKCMACCT.BKCM_ACCT_NAME}
Else
If {?SortField} startswith "S" then {BKCMACCT.BKCM_ACCT_STATE}
Else
If {?SortField} startswith "Z" then {BKCMACCT.BKCM_ACCT_ZIP}
Else
{BKCMACCT.BKCM_ACCT_CODE}
3. Grouped details by the formula (Sort) in

Everything I've tried is saying that I'm breaking a different rule. Does
Lev Semenets [MSFT]
8/18/2005 10:41:22 PM
You can sort by expression similar to this:
=Fields(Parameters!SortFieldName.Value).Value
where parameter SortFieldName is set to desired field.

--
This posting is provided "AS IS" with no warranties, and confers no rights.


[quoted text, click to view]

AddThis Social Bookmark Button