LocalReport.SetParameters Method (IEnumerable<ReportParameter>)

 

Sets report parameter properties for the local report.

Namespace:   Microsoft.Reporting.WinForms
Assembly:  Microsoft.ReportViewer.WinForms (in Microsoft.ReportViewer.WinForms.dll)

Syntax

public override void SetParameters(
    IEnumerable<ReportParameter> parameters
)
public:
virtual void SetParameters(
    IEnumerable<ReportParameter^>^ parameters
) override
override SetParameters : 
        parameters:IEnumerable<ReportParameter> -> unit
Public Overrides Sub SetParameters (
    parameters As IEnumerable(Of ReportParameter)
)

Parameters

Remarks

The parameters specified for the SetParameters method must be defined in the original report definition.

Examples

Legacy Code Example

The following code example shows a report parameter being set to the value of a check box on a form.

private void SetReportParameters() {
   ReportParameter p1 = new 
      ReportParameter("ShowDescriptions", checkBox1.Checked.ToString());
   ReportParameter p2 = new 
      ReportParameter("ShowTitle", checkBox2.Checked.ToString());
   this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { p1, p2 });
}
Private Sub SetReportParameters()
   Dim p1 As New ReportParameter("ShowDescriptions", _
     CheckBox1.Checked.ToString())
   Dim p2 As New ReportParameter("ShowTitle", _
     CheckBox2.Checked.ToString())
   ReportViewer1.LocalReport.SetParameters(New ReportParameter() {p1, p2})
End Sub

See Also

SetParameters Overload
LocalReport Class
Microsoft.Reporting.WinForms Namespace

Return to top