Need to trap output from Parameter

  • SSRS Gurus (I don't know the plural of Guru - Guri? Gura?):hehe:

    I want my report to show the selected parameters of the 'Project' field. If the selection is 'All' then I just want to show the word 'All'. If the user selects a subset of the projects \, then I want to show the actual project names selected. Can I trap the output and build it into my expression to display either the 'All' or Project names depending on the parameter selection?

    Thanks,

    David

  • Looks like the Gurae have not responded, so you're stuck with me.. 😛

    To show a list of the selected parameters, you'd use field expression:

    =Join(Parameters!Project.Value,", ")

    or to show the labels:

    =Join(Parameters!Project.Label,", ")

    To show the word 'All' when all of the options are selected, you'll need to add another dataset similar to the one that provides the values for project. For example, if the dataset for the parameter is something like:

    SELECT ProjectID as Value, ProjectName as Label from Projects

    create a new dataset like:

    SELECT Count(ProjectID) from Projects

    Then, in the field expression, you'll use:

    =iif(Parameters!Project.Count = Sum(Fields!ParamCount.Value, "ParamCount"), "All", Join(Parameters!Project.Label,", ") )

    Basically, this expression: Parameters!Project.Count provides a count of all of the parameter options that were selected by the user. The IIF compares the user count with the count from the new dataset. If they match, user has selected all. If not, show the list.

    [font="Courier New"]Looking for a Deadlock Victim Support Group..[/font]
  • Perfect,

    Thanks very much Burninator!

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

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