How to pass multiple values to one SSRS parameter programmatically (VB.NET, C#)

bokloz2

New Member
I need to pass multiple values to one SSRS parameter programmatically (VB.NET, C#). e.g. several counties to a report parameter called "country". This can be easily done manually ba defining the parameter as multi valued parameter and choosing multiple parameter values by activating the checkboxes of the parameter at runtime. But is there a way to do it programmatically in VB.NET or C#?I have tried the following with out success:\[code\] ReportParameterInfoCollection @params = default(ReportParameterInfoCollection); @params = this.ReportViewer1.ServerReport.GetParameters(); List<ReportParameter> changedParams = new List<ReportParameter>(); foreach (ReportParameterInfo paramInfo in @params) { ReportParameter param = new ReportParameter(); param.Name = paramInfo.Name; if ((paramInfo.Name == "Terminal") { //param.Values.Add(User.Identity.Name); string[] values = new string[] { "Some Terminal", "Some Other Terminal" }; param.Values.AddRange(values); } changedParams.Add(param); } this.ReportViewer1.ServerReport.SetParameters(changedParams);\[/code\]Thank you for your assistance.
 
Back
Top