Display Multivalue Parameters in the Report Title

  • I am rather new to SSRS and feel dumb asking this question, but here it goes.

    I have a report that lets users select 1 to Many months of information. i.e. User can select June 2007, or select June 2007, July 2007, & August 2007....etc. In the title, I can display 1 selected month easily....

    ="Record Errors for " + Parameters!pMoYrSelect.Value(0)

    . If I knew the exact number of months that would always be selected, I could just do something like

    ="Record Errors for " + Parameters!pMoYrSelect.Value(0) +", "+Parameters!pMoYrSelect.Value(1)

    +", "+Parameters!pMoYrSelect.Value(2)+", "+Parameters!pMoYrSelect.Value(3)

    However, that does not work if the user is going to always select a different amount of months to view. How do I get any amount of selected months to display in the title? I had found a forum user posted to try

    To show multivalue parameters can try something like this:

    = Join(Parameters!Customer_Group.Value,", ") & " customers. Records Found: (" & CountRows().ToString & ")"

    , but this didn't work when I tried it.

    Any help would be great. Thanks!!

  • Gekko (5/28/2008)


    I am rather new to SSRS and feel dumb asking this question, but here it goes.

    I have a report that lets users select 1 to Many months of information. i.e. User can select June 2007, or select June 2007, July 2007, & August 2007....etc. In the title, I can display 1 selected month easily....

    ="Record Errors for " + Parameters!pMoYrSelect.Value(0)

    . If I knew the exact number of months that would always be selected, I could just do something like

    ="Record Errors for " + Parameters!pMoYrSelect.Value(0) +", "+Parameters!pMoYrSelect.Value(1)

    +", "+Parameters!pMoYrSelect.Value(2)+", "+Parameters!pMoYrSelect.Value(3)

    However, that does not work if the user is going to always select a different amount of months to view. How do I get any amount of selected months to display in the title? I had found a forum user posted to try

    To show multivalue parameters can try something like this:

    = Join(Parameters!Customer_Group.Value,", ") & " customers. Records Found: (" & CountRows().ToString & ")"

    , but this didn't work when I tried it.

    Any help would be great. Thanks!!

    From the title of the post, I assume that you're talking about the selection of the dates being in a Multi-Value parameter.

    If so, change your code to:

    "Record Errors for " & Join(Parameters!pMoYrSelect.Value, ", ")

    or

    "Record Errors for " & Join(Parameters!pMoYrSelect.Label, ", ")

    the omission of the (x) is deliberate, and uses the whole thing. .Value shows the underlying values, .Label shows what was displayed to the user.

    HTH,

    Wayne

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • Thank you so much for your help! Worked perfectly.

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

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