The requested page is not available for the requested platform. You are viewing the content for Default platform.

XRSubreport.ParameterBindings Property

Provides access to the collection of subreport parameter bindings, which allow you to bind a subreport's parameter value to a master report's data field.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v19.1.dll

Declaration

[SRCategory(ReportStringId.CatData)]
public ParameterBindingCollection ParameterBindings { get; }
<SRCategory(ReportStringId.CatData)>
Public ReadOnly Property ParameterBindings As ParameterBindingCollection

Property Value

Type Description
ParameterBindingCollection

A ParameterBindingCollection object, specifying the collection of subreport parameter bindings.

Remarks

The parameter binding feature is useful when creating master-detail reports using subreports. You can bind a subreport's parameter used as a filtering criterion to a master report's data field, which will serve as a source of the parameter value. To do this, add a ParameterBinding object with the required settings to the ParameterBindings collection.

Examples

This example illustrates how to pass the value of a report parameter to a subreport placed in a another report.

To do this, create a ParameterBinding object and add it to the XRSubreport.ParameterBindings collection.

In this example, the main report is bound to the Categories table of the sample Northwind database (nwind.mdb file is shipped with XtraReport installation). A detail report should use data from the Products table of the same database and contain an appropriate CatID parameter.

To learn how to solve this task without writing any code, see Creating a Master-Detail Report using Subreports.

using DevExpress.XtraReports.UI;
// ...

private void XtraReport1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {
    XtraReport report = sender as XtraReport;
    XRSubreport subreport = report.FindControl("xrsubreport1", true) as XRSubreport;
    ParameterBinding parameterBinding = new ParameterBinding("CatID", null, "Categories.CategoryID");
    subreport.ParameterBindings.Add(parameterBinding);
}
See Also