Forum Discussion

rogerdea's avatar
rogerdea
Icon for Helper IV rankHelper IV
3 years ago

Report Builder - Display selected parameters on report page

Hello

 

Is it possible to show parameter selections on a report builder paginated report?  e.g.  I have a list of years and as users could be printing out the report, is would be important to know the parameters selected on the report itself.

 

Is this possible?

 

Thanks

6 Replies

  • Jon-Heide's avatar
    Jon-Heide
    Icon for Microsoft Employee rankMicrosoft Employee

    Yes. In the body of the report, add a text box. 

     

    In the textbox, set the expression to =Parameters![NameOfYourParameter].Value

     

    That should show the selected value of the parameter within the body of the report. 

    • jrunion2's avatar
      jrunion2
      New Member

      Use this instead---  replace "DateTableYear" with your parameter name and it'll display your chosen parameters in a text box, separated by commas.

       

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

  • Thanks for the reply, I did as you suggested by entering =Parameters![DateTableYear].Value into a text box, but it's returning #error on the report.

     

    My Parameter:

     

     

    Any ideas why?  It correctly changes the text in the box to <<Expr>> so i know it's accepted the code.

     

    Thanks

     

     

    • jrunion2's avatar
      jrunion2
      New Member

      Use this instead---  replace "DateTableYear" with your parameter name and it'll display your chosen parameters in a text box, separated by commas.

       

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

  • bhenson's avatar
    bhenson
    Regular Visitor

    I know that this thread is old but I finally solved the issue.
    =Parameters!YourParameterNameHere.Value(0)
    Use that for if you only expect 1 value to be returned.

    For the potential of multiple values being selected use
    =Join(Parameters!YourParameterNameHere.Value,”, ”)
    using .Label instead of .Value can result in awkward spacing between selected variables. You can test it out with your data.

    The reason why this happens is because Parameters are Arrays. So if you want a particular value from the array then you need the .Value(value position). For the Join it will work through the entire array so you don't want to limit it to a particular value. Note that Arrays start at 0 not 1.

    • Powerwoman's avatar
      Powerwoman
      Icon for Helper II rankHelper II

      Hi bhenson :
      thanks for your input! Do you also have a solution if no parameter is selected that something like 'all' is displayed?