Display Parameter with a description

  • Hello,

    I am translating Crystal Reports to SSRS.

    In Crystal Reports, when adding parameters, it allowed you to easily display a description field with the parameter field value.

    For example, I could display the project name with the project ID but the value passed to the query would be the project ID number.

    1234 - Project A

    1235 - Project B

    1237 - Project C

    1238 - Project D

    Is there a way to do this in SSRS? Is there somewhere I can add an expression to join Project Name and Project ID so that both display as options the user can select?

    Thanks

    Heidi's Mom

  • In Crystal Reports, when adding parameters, it allowed you to easily display a description field with the parameter field value.

    For example, I could display the project name with the project ID but the value passed to the query would be the project ID number.

    1234 - Project A

    1235 - Project B

    1237 - Project C

    1238 - Project D

    Is there a way to do this in SSRS? Is there somewhere I can add an expression to join Project Name and Project ID so that both display as options the user can select?

    If you create a parameter you can set it to get its values from a column in a dataset, and optionally display a text value instead of the key value. In your case, you would create a dataset of all Projects and corresponding ProjectIDs. Then you would have a Report Parameter, say prmProject... then set the datatype to the first column (the one you're filtering by, not the one you're displaying). On the left of the Parameter Properties window, choose "Get values from a query" - then you can choose a dataset and Value/Label fields. The dataset is the one that returns your list of (ProjectID, ProjectName). The value field is the ProjectID, and the Label field is the ProjectName -- that's the one that's displayed in the dropdown.

    if you wanted both the ProjectID and the name displayed in the dropdown you'd have to base the dropdown on something like

    SELECT ProjectID, ProjectID & " - " & ProjectName

    FROM Projects

  • Thank you pietlinden!

    I tried it and that worked for me...

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

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