Back to Devexpress

ParameterBindingCollection Class

xtrareports-devexpress-dot-xtrareports-dot-ui-bb2d5e78.md

latest4.1 KB
Original Source

ParameterBindingCollection Class

A collection of ParameterBinding objects.

Namespace : DevExpress.XtraReports.UI

Assembly : DevExpress.XtraReports.v25.2.dll

NuGet Package : DevExpress.Reporting.Core

Declaration

csharp
public class ParameterBindingCollection :
    Collection<ParameterBinding>
vb
Public Class ParameterBindingCollection
    Inherits Collection(Of ParameterBinding)

The following members return ParameterBindingCollection objects:

Remarks

Use the XRSubreport.ParameterBindings property to access a ParameterBindingCollection class instance and its members.

Example

The code sample below adds an XRSubreport to the report and uses the ReportSourceUrl property to reference a detail report. The sample also binds the referenced report’s parameter to the main report’s data field.

Tip

Online Example : Use Subreports to Add a Chart

csharp
using System.IO;
using System.Drawing;
using DevExpress.XtraReports.UI;
using DevExpress.XtraReports.Parameters;
// ...
XRSubreport subreport = new XRSubreport() {
    BoundsF = new RectangleF(0, 100, 550, 25),
};
// "mainReport" is an XtraReport instance.
// Add subreport to the main report's DetailBand.
mainReport.Bands["DetailBand"].Controls.Add(subreport);
// Reference a report from the report definition (REPX) file. The file is stored in the application's folder.
subreport.ReportSourceUrl = Path.Combine(Path.GetDirectoryName(typeof(ReportCreator).Assembly.Location), "DetailReport.repx");
// Bind the detail report's "prmCategory" parameter to the main report's "Categories.CategoryID" data field.
subreport.ParameterBindings.Add(new ParameterBinding("prmCategory", null, "Categories.CategoryID"));
vb
Imports System.IO
Imports System.Drawing
Imports DevExpress.XtraReports.UI
Imports DevExpress.XtraReports.Parameters
' ...
Dim subreport As New XRSubreport() With {.BoundsF = New RectangleF(0, 100, 550, 25)}
' "mainReport" is an XtraReport instance.
' Add subreport to the main report's DetailBand.
mainReport.Bands("DetailBand").Controls.Add(subreport)
' Reference a report from the report definition (REPX) file. The file is stored in the application's folder.
subreport.ReportSourceUrl = Path.Combine(Path.GetDirectoryName(GetType(ReportCreator).Assembly.Location), "DetailReport.repx")
' Bind the detail report's "prmCategory" parameter to the main report's "Categories.CategoryID" data field.
subreport.ParameterBindings.Add(New ParameterBinding("prmCategory", Nothing, "Categories.CategoryID"))

Inheritance

Object Collection<ParameterBinding> ParameterBindingCollection

See Also

ParameterBindingCollection Members

ParameterBinding

ParameterBindings

DevExpress.XtraReports.UI Namespace