Back to Devexpress

Parameter.ExpressionBindings Property

corelibraries-devexpress-dot-xtrareports-dot-parameters-dot-parameter-f5fbd0ad.md

latest4.7 KB
Original Source

Parameter.ExpressionBindings Property

Provides access to the parameter’s expression bindings collection.

Namespace : DevExpress.XtraReports.Parameters

Assembly : DevExpress.Printing.v25.2.Core.dll

NuGet Package : DevExpress.Printing.Core

Declaration

csharp
[Browsable(false)]
public BasicExpressionBindingCollection ExpressionBindings { get; }
vb
<Browsable(False)>
Public ReadOnly Property ExpressionBindings As BasicExpressionBindingCollection

Property Value

TypeDescription
BasicExpressionBindingCollection

The parameter’s expression bindings collection.

|

Remarks

The collection to which ExpressionBindings provides access stores BasicExpressionBinding elements for Parameter‘s properties. An expression that is parsed and processed to specify a property value:

A property’s expression binding overrides the PropertyName‘s value. Invalid values (for instance, an alphabetical value for an integer parameter) are converted to zero or empty values.

Tip

A basic expression binding’s visibility scope is limited to constants, operators, and date-time / logical / math / string functions.

Example

The code sample below illustrates how to create a date parameter with the current date as the default value and filter report data by the created parameter.

csharp
using DevExpress.XtraReports.Parameters;
using DevExpress.XtraReports.Expressions;
// ...
XtraReport1 report = new XtraReport1();

Parameter myDateParameter = new Parameter();
myDateParameter.Name = "myDateParameter";
// Set the Visible property to true to request the parameter value from users.
// Set this property to false to silently apply the parameter's value.
myDateParameter.Visible = false;
myDateParameter.Type = typeof(System.DateTime);
// Set the parameter's value to the current date.
myDateParameter.ExpressionBindings.Add(new BasicExpressionBinding("Value", "Today()"));
report.Parameters.Add(myDateParameter);
// Filter report data by the specified parameter.
report.FilterString = "GetDate([OrderDate]) = ?myDateParameter";
vb
Imports DevExpress.XtraReports.Parameters
Imports DevExpress.XtraReports.Expressions
' ...
Dim report As New XtraReport1()

Dim myDateParameter As New Parameter()
myDateParameter.Name = "myDateParameter"
' Set the Visible property to true to request the parameter value from users.
' Set this property to false to silently apply the parameter's value.
myDateParameter.Visible = False
myDateParameter.Type = GetType(Date)
' Set the parameter's value to the current date.
myDateParameter.ExpressionBindings.Add(New BasicExpressionBinding("Value", "Today()"))
report.Parameters.Add(myDateParameter)
' Filter report data by the specified parameter.
report.FilterString = "GetDate([OrderDate]) = ?myDateParameter"

See Also

Parameter Class

Parameter Members

DevExpress.XtraReports.Parameters Namespace