none
First(Fields!Department.Value, "ds")

    Question

  • Hello!

    In a report, We want to make sure that a heading is displaced based on the parameters selected by the user. This was working so well when a user was not allowed to select multiple values from a drop down list. Now that a user can now choose multiple values we keep getting error(#Error) An attempt to remedies it see us getting just the first value in the parameter drop down list.

    The expression is ,"

    =

    Globals!ReportName&" "&" - "&Parameters!Month.Value&" "&Parameters!Year.Value&"("&First(Fields!Department.Value,"dsxx")&")"

    I know that the key word, "First" is responsible for that. How do we get this sorted to give accurate result set so that all parameters selected are returned in the list?

    Thanks for the help

     

    Zionlite

    Monday, November 11, 2013 10:23 PM

Answers

  • Hi Zionlite,

    If I understand correctly, the report works well when the user select a value from a drop-down list of a single parameter. While when the signal parameter changes to multiple parameter, then we will get #error in the report after selecting multiple values from the drop-down list. If I have misunderstood, please don't hesitate to let me know.

    In Reporting Services, if the parameter is a signal parameter, we can directly use the expression below to display the parameter in the report.

    =Parameters!parameter_name.Value

    While if the parameter is a multiple parameter, we should use join function as below to display the parameter in the report:

    =join(Parameters! parameter_name.Value,",")

    So in your scenario, I suggest that you should double check the two parameters in the report, then use the correct format in the expression.

    If you have any more questions, please feel free to ask.

    Regards,
    Katherine Xiong


    Katherine Xiong
    TechNet Community Support

    • Marked as answer by Yookos Friday, November 15, 2013 8:54 AM
    Wednesday, November 13, 2013 7:58 AM
  • Thanks for the reply. Like you explained, that is what I want to do but not to return the lists of all parameters but the very parameter(s) supplied.

    Let say I have up to 6 parameters and I only selected 3 of the parameters, I want that the list the return value would be the selected parameters.

    How does that work?

    Thank you


    Zionlite

    • Marked as answer by Yookos Friday, November 15, 2013 8:54 AM
    Thursday, November 14, 2013 11:13 AM

All replies

  • Hi Zionlite,

    If I understand correctly, the report works well when the user select a value from a drop-down list of a single parameter. While when the signal parameter changes to multiple parameter, then we will get #error in the report after selecting multiple values from the drop-down list. If I have misunderstood, please don't hesitate to let me know.

    In Reporting Services, if the parameter is a signal parameter, we can directly use the expression below to display the parameter in the report.

    =Parameters!parameter_name.Value

    While if the parameter is a multiple parameter, we should use join function as below to display the parameter in the report:

    =join(Parameters! parameter_name.Value,",")

    So in your scenario, I suggest that you should double check the two parameters in the report, then use the correct format in the expression.

    If you have any more questions, please feel free to ask.

    Regards,
    Katherine Xiong


    Katherine Xiong
    TechNet Community Support

    • Marked as answer by Yookos Friday, November 15, 2013 8:54 AM
    Wednesday, November 13, 2013 7:58 AM
  • Thanks for the reply. Like you explained, that is what I want to do but not to return the lists of all parameters but the very parameter(s) supplied.

    Let say I have up to 6 parameters and I only selected 3 of the parameters, I want that the list the return value would be the selected parameters.

    How does that work?

    Thank you


    Zionlite

    • Marked as answer by Yookos Friday, November 15, 2013 8:54 AM
    Thursday, November 14, 2013 11:13 AM
  • The Join statement provided by Katherine does that. It joins the selected values of the multivalue parameter with ",". So if you have a multivalue parameter with 6 allowed values, 1, 2, 3, 4, 5, 6, and you select only 1 and 5, Katherines formula will display "1,5". You may wish to modify hers to =join(Parameters! parameter_name.Value,", "). Note I added a space after the comma used for the join character. With this change, my example will display "1, 5" instead of "1,5".

    "You will find a fortune, though it will not be the one you seek." - Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

    Thursday, November 14, 2013 7:29 PM