For displaying drop down list for the values of paramenters
If you want that your ssrs report show drop down list for the values of parameters insted of entering a value by hand. then first create a procedure for that paramete.
eg you have a parameter Project and you want to display all projects names in drop down list on report.
then create procedure which retrieves you all projectsID's and projectNames like:
(select Projet.ProjectID, Projet.ProjectName from Projet)
and add this procedure as a dataset in the report
then return on report select parameter from Report Data tool bar go to its properties in general properties check the box "Allow multiple values", now click on Avaliable values option from left pane.In this option check the radio button "get values from a query" Select dataset which you have creted for that paramenter(which retrieves you id and name like i have created for Project). In "value field" select id (which you want to match with query parameters eg ProjectID)
and in "Label fields" select name (which you want to display in drop down list values. eg ProjectName) then click on ok. now run the report your report will show drop down list for the values.
eg you have a parameter Project and you want to display all projects names in drop down list on report.
then create procedure which retrieves you all projectsID's and projectNames like:
(select Projet.ProjectID, Projet.ProjectName from Projet)
and add this procedure as a dataset in the report
then return on report select parameter from Report Data tool bar go to its properties in general properties check the box "Allow multiple values", now click on Avaliable values option from left pane.In this option check the radio button "get values from a query" Select dataset which you have creted for that paramenter(which retrieves you id and name like i have created for Project). In "value field" select id (which you want to match with query parameters eg ProjectID)
and in "Label fields" select name (which you want to display in drop down list values. eg ProjectName) then click on ok. now run the report your report will show drop down list for the values.
and in the main dataset use fn_split function to handel multiple values for the parameter otherwise it will show error.And set Parameter to text from its properties.
ReplyDeleteFor example
-- use this
@ProjectID varchar(25)
where
(Project.intProjectID in (select item from fn_split(@ProjectID, ',')))