Displaying all Values of multiple selected Parameter in Text Box with Comma Separating the Values in SSRS
Today while Creating a Report the client requirement was to show all ResourceName in the Report Header so i thought to have a blog on this
It's like displaying multiples ResourceName in a text box .
EG -Vijay,Suresh,Amit,Ankit -In a Single TextBox
In order to acheive this result
We will consider a table Resources with column ResourceName
CASE 1- To show all column values in TextBox
create a Dataset
Select top 20 ResourceName from Resources
Drag a Text Box in your Report Header
In order to display these ResourceNames values in a Text Box
Right click -Text Box Expression
=Join(LookupSet(1,1,Fields!ResourceName.Value, "DataSetSummary")," , ")
Output-Vijay,Suresh,Amit,Ankit
Explanation: The Lookup function will check the source value which is 1 match with Destination value 1
giving the Resultant as All ResourceName as 1=1 will always true
The outer Join Function will take two Parameter ResourceNames and Join it with Comma to Get Comma Separated Value
Case 2 Where you are Displaying your Multiple Selected ResourceName from ResourceName Parameter into the Text Box
=Join(Parameters!resourcename.Label, ",")
Explanation: Resourcename is the name of Parameter Join function to make it as Comma Separeted Value in Textbox .Label because we are displaying Label field in the Text Box if you have same value and Label filed you can write .Value also.
=Join(Parameters!resourcename.Value, ",")
Output-Vijay,Suresh,Amit,Ankit
Note: In above examples i have skipped simple parts like creating Dataset part creating Parameter in order to know how to create Dataset and Parameter check my previous Blogs.
No comments:
Post a Comment