locked
1 dataset, two values RRS feed

  • Question

  • User746043490 posted

    Good Day to you!

    I have a stored procedure that uses two parameters, UserName and Userid. I have created a dataset that holds both pieces of information. Here's my delimma, when the report is run, the employee has to select their name from the Parameter drop down box but I can't figure out how to pass the selected Username's Userid as the second parameter.

    Any help is greatly appreciated.

    Monday, October 14, 2013 7:37 PM

Answers

  • User-1051986203 posted

    You need to do cascading parameters method, Suppose you have two parameters '@UserName' and '@Userid', Please try to follow steps:

    1. Create 1 dataset for UserName parameter

    select distinct UserName from @table
    

    2. Create another dataset for Userid parameter

    select distinct Userid from @table where UserName=@UserName

    Map these two dataset with parameter, you will get Userid value based on selected UserName.

    Please see below url for more details:

    http://blogs.technet.com/b/andrew/archive/2007/12/19/sql-server-2008-reporting-services-cascading-prompts.aspx



     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, October 19, 2013 7:31 PM

All replies

  • User-1392847221 posted

    Hi,

    As you are using Dropdown then there are two values are available in dropdown

    if you dig in SelectedItem  then you will find selectedValue  and selectedText.

     

    Like in binding of drop down you have to give two value one if for value & text

    Monday, October 14, 2013 10:24 PM
  • User-1051986203 posted

    You need to do cascading parameters method, Suppose you have two parameters '@UserName' and '@Userid', Please try to follow steps:

    1. Create 1 dataset for UserName parameter

    select distinct UserName from @table
    

    2. Create another dataset for Userid parameter

    select distinct Userid from @table where UserName=@UserName

    Map these two dataset with parameter, you will get Userid value based on selected UserName.

    Please see below url for more details:

    http://blogs.technet.com/b/andrew/archive/2007/12/19/sql-server-2008-reporting-services-cascading-prompts.aspx



     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, October 19, 2013 7:31 PM