Вопрос

I'm very new to SSRS and SQL and I'm creating a report in Report Builder 3.0.

I have no problem in creating a new blank report, adding a datasource and a dataset. My Dataset is pretty basic:

SELECT  Employee_NO, Employee_Name
FROM    Employees

I have added a parameter for Employee_Name so the user can select an employee. I have also created a hidden parameter for Employee_NO

I have added two boxes on the report: One for Employee_Name and one for Employee_No. The first box is populated with the selection from the Employee_Name parameter but I somehow need to populate the other box with the specified users Employee_No. How do I achieve this?

Это было полезно?

Решение

the way it usually works is you add a dataset with the query you need to populate the parameters (called dataset2 in this case):

select Employee_NO, Employee_Name from Employees

and then you create the parameter (right click on the parameters item on the report data tab) based on the dataset2

enter image description here

There you have your parameter.

To use it on your main query you referenci it with a @:

select * from your_table 
where empid=@empId

just reference it: enter image description here

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top