grouping based on parameter selected

  • 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

  • Hi Pravin,

    Do you want to perform grouping in sql query or else in your report layout?

  • 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

  • Thanks Steve, I think that will come in very helpful for me in the future too...

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply