0

enter image description hereI am working on a SSRS Report and I have two Parameters in the Prompt section, EmployeeID and EmployeeName respectively.

EmployeeName prompt depends on the EmployeeID prompt selected, can the EmployeeName be populated in a textbox once EmployeeID is selected.

Right now EmployeeID is being shown in a drop-down and the user have to go to the drop-down and select it, can it be done in a textbox?

Any help would be greatly appreciated!

Vaibhav Sinha
  • 67
  • 1
  • 2
  • 10
  • I'm not clear what you are trying to do. What parameter is getting passed to the report? EmployeeID, EmployeeName or both? Are you populating the drop downs from a table, if so, what is the structure of that table. I'll post an answer based on a typical scenario and update it once you have responded if necessary. – Alan Schofield Apr 07 '17 at 08:46

1 Answers1

0

Create your main report dataset (dsMain for exmaple) with a query something like

SELECT * FROM myTable WHERE EmployeeID = @EmployeeID

I'm assuming you have the first parameter setup and working correctly to return your list EmployeeIDs. For this example we'll call this parameter EmployeeID/

Create another dataset (called for example, dsEmployeeName) with a query something like

SELECT EmployeeName from myEmployeeTable WHERE EmployeeID = @EmployeeID

In the second parameter (the one you want showing in a text box), leave the 'Available Values' blank and set the 'Default Values' to be from a query. Choose dsEmployeeName as the dataset and choose EmployeeName as the Value.

NOTE This will only work the first time round. If you choose another value from the drop down, the name will not be updated.

I don't know your exact requirements but if you can get both the ID and name together, why do you need two parameters, one of which does nothing really as it's not passed to the report?

Alan Schofield
  • 19,839
  • 3
  • 22
  • 35
  • Thanks for your answer, but that is not what I want. Below steps am doing, (1) I enter EmployeeID in prompt (2) The EmployeeName prompt gets auto-populated using first prompt from a dsemployee dataset. But that particular EmployeeName comes in a drop-down list(alone) and after doing step (1), user goes to the drop down and select that EmployeeName. What I want is that the EmployeeName prompt gets auto-populated without user selecting the name from drop-down. – Vaibhav Sinha Apr 07 '17 at 08:58
  • Maybe post some screenshots too, the more info you can share the more people will be able to help. – Alan Schofield Apr 07 '17 at 09:03
  • ps:- EmployeeID is only getting passed to the report procedure and not EmployeeName – Vaibhav Sinha Apr 07 '17 at 09:03
  • Added a screenshot – Vaibhav Sinha Apr 07 '17 at 09:06