Skip to main content

RangeParametersSettings.EndParameter Property

A range parameter’s nested end parameter.

Namespace: DevExpress.XtraReports.Parameters

Assembly: DevExpress.Printing.v24.1.Core.dll

NuGet Package: DevExpress.Printing.Core

Declaration

[XtraSerializableProperty(XtraSerializationVisibility.Reference)]
public RangeEndParameter EndParameter { get; }

Property Value

Type Description
RangeEndParameter

A range parameter’s end value.

Remarks

Note

If the parameter’s Visible property is set to true, users are requested to select the start and end dates before the report is generated. The selected start and end dates include the 12:00:00 AM time. If your data include non-midnight time, records for the selected end date are excluded from the report. Use the GetDate() function in the report’s FilterString expression to include data for the selected end date.

Example

The code sample below uses a RangeParametersSettings class instance to create a date range parameter, set the range value to the last 7 days, and filter report data by this range.

using DevExpress.XtraReports.Parameters;
using DevExpress.XtraReports.Expressions;
// ...
XtraReport1 report = new XtraReport1();
// Create a date range parameter.
Parameter myDateRange = new Parameter();
myDateRange.Name = "myDateRange";
myDateRange.Description = "Date Range:";
// 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.
myDateRange.Visible = false;
myDateRange.Type = typeof(System.DateTime);
RangeParametersSettings myDateRangeSettings = new RangeParametersSettings();
myDateRangeSettings.StartParameter.Name = "MyDateRangeStart";
// Set the range parameter's start date to 7 days ago.
myDateRangeSettings.StartParameter.ExpressionBindings.Add(new BasicExpressionBinding("Value", "AddDays(Today(), -7)"));
myDateRangeSettings.EndParameter.Name = "MyDateRangeEnd";
// Set the range parameter's end date to today.
myDateRangeSettings.EndParameter.ExpressionBindings.Add(new BasicExpressionBinding("Value", "Today()"));
myDateRange.ValueSourceSettings = myDateRangeSettings;
report.Parameters.Add(myDateRange);
// Filter report data by the specified start and end dates.
report.FilterString = "GetDate([OrderDate]) Between(?MyDateRangeStart,?MyDateRangeEnd)";
See Also