LocalReport.SetParameters, méthode (IEnumerable<ReportParameter>)
Définit les propriétés des paramètres du rapport local.
Espace de noms : Microsoft.Reporting.WebForms
Assembly : Microsoft.ReportViewer.WebForms (dans Microsoft.ReportViewer.WebForms.dll)
Syntaxe
'Déclaration
Public Overrides Sub SetParameters ( _
parameters As IEnumerable(Of ReportParameter) _
)
public override void SetParameters(
IEnumerable<ReportParameter> parameters
)
public:
virtual void SetParameters(
IEnumerable<ReportParameter^>^ parameters
) override
abstract SetParameters :
parameters:IEnumerable<ReportParameter> -> unit
override SetParameters :
parameters:IEnumerable<ReportParameter> -> unit
public override function SetParameters(
parameters : IEnumerable<ReportParameter>
)
Paramètres
- parameters
Type : IEnumerable<ReportParameter>
IEnumerable d'objets ReportParameter qui contient la liste des propriétés des paramètres du rapport.
Notes
The parameters specified for the SetParameters method must be defined in the original report definition.
Exemples
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