Appframe Knowledge Base


1 hits
0

How to use report parameters through code

' Step 1:
' -------
' Create report parameters in the designer with default values*. Make sure that the
' "Show in the parameters panel" box is unchecked.
'
' * see: http://documentation.devexpress.com/#XtraReports/CustomDocument9998/Creating
'
' Step 2:
' -------
' Create the applicable *ReportArgs object in your form, pass parameters through the
' AddParameter method:

Dim vArgs As New OpenReportArgs("arpt_Demo_MyReportWithParameters")
vArgs.AddParameter("Foo",           ' Name
                   GetType(String), ' Type
                   "Bar") '         ' Value

CR3.OpenReport(vArgs)

' Step 3:
' -------
' To consume the parameters in your report, use the Parameters property. Example:

Private Sub XtraReport_BeforePrint(
	ByVal sender As Object,
	ByVal e As System.Drawing.Printing.PrintEventArgs)

	Dim vFoo = Parameters("Foo")

	cFooLabel.Text = Parameters("Foo").Value

End Sub

reporting win · Perma link post comment Posted by: Jarl Erik Schmidt (12-feb-2013)