views:

94

answers:

1

How do we set the parameters of .Net's reportviewer?

+3  A: 
List<ReportParameter> paramList = new List<ReportParameter>();
paramList.Add(new ReportParameter("ClientName", clientName, false)); 
TheReportObject.LocalReport.SetParameters(paramList);

And you have to make sure you define the same named parameters inside the report definition as well.

DancesWithBamboo
Thanks a lot for the tip.!
Note that sending false to the ReportParameter constructor will hide the parameter from the user. If you don't intend to hide the parameter, there's an overload that doesn't take that boolean (or send true).
Liron Yahdav