Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

grouping based on parameter selected Expand / Collapse
Author
Message
Posted Sunday, September 26, 2010 6:09 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, February 2, 2011 12:25 PM
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
Post #993403
Posted Monday, September 27, 2010 3:05 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, December 28, 2010 4:35 AM
Points: 7, Visits: 71
Hi Pravin,

Do you want to perform grouping in sql query or else in your report layout?
Post #993506
Posted Monday, September 27, 2010 6:07 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Yesterday @ 10:42 AM
Points: 593, Visits: 2,110
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

Post #993583
Posted Monday, September 27, 2010 3:56 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Friday, September 5, 2014 2:00 PM
Points: 2,160, Visits: 2,191
Thanks Steve, I think that will come in very helpful for me in the future too...
Post #994089
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse