Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


grouping based on parameter selected


grouping based on parameter selected

Author
Message
sql.pravin
sql.pravin
Grasshopper
Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)

Group: General Forum Members
Points: 10 Visits: 72
Hi,

I'm developing a SSRS 2005 report, where grouping depends on the value selected as the parameter


Ex: Parameter dropdown has 2 values i.e., 1) state and 2) company
1) If i select state, then the grouping should be as follows
state and then company
2) If i select company, then the grouping should be as follows
Company and then state

can we dynamically change grouping depending on the parameter value selected ?

Thanks
Pravin
peace.cog
peace.cog
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 71
Hi Pravin,

Do you want to perform grouping in sql query or else in your report layout?
Steven.Howes
Steven.Howes
SSChasing Mays
SSChasing Mays (652 reputation)SSChasing Mays (652 reputation)SSChasing Mays (652 reputation)SSChasing Mays (652 reputation)SSChasing Mays (652 reputation)SSChasing Mays (652 reputation)SSChasing Mays (652 reputation)SSChasing Mays (652 reputation)

Group: General Forum Members
Points: 652 Visits: 2328
I do this a lot in my reports. You can even tailor the layout of your headers and Detail areas using the same expression.
Enter this in the grouping expression box.

If you just have the two Choices:
=iif(parameters!Parametername.value='State', Fields!State.Value,Fields!Company.Value)

If you jave more than two
=iif(parameters!Parametername.value='State', Fields!State.Value,Fields!Company.Value)
iif(parameters!Parametername.value='Company', Fields!Company.Value,
Etc.
)
)

When I do something like this I also add a extra Header row and details row for each choince i the drop down.
Then I Set the Visibility I useing the same expression
=iif(parameters!Parametername.value='State', False,True) For the State Header and Details row
=iif(parameters!Parametername.value='State', False,True) For the Company Header and Detail Row

This gives you a lot of control over what gets displayed when either group is selected
UMG Developer
UMG Developer
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2280 Visits: 2204
Thanks Steve, I think that will come in very helpful for me in the future too...
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search