Partilhar via


FAQ: HOW do I work Parameters with a local report?

Question

 I want to display parameter prompts for my local report in reportviewer control, however it does not work.

 Answer

 Currently this is a product limitation for reportviewer displaying local report. You have to create the parameter prompts on your web page and submit the parameters with ReportViewer.LocalReport.SetParameters as follows:

   ReportParameter p = new ReportParameter();

    p.Name = "EmployeeID";

    p.Values.Add(this.drpEmpList.SelectedValue);

    this.ReportViewer1.LocalReport.SetParameters(p);

    this.ReportViewer1.LocalReport.Refresh();

  

Applies to 

Visual Studio 2008

Visual Studio 2010