Skip to main content

RangeParameterEditorOptions.PredefinedDateRanges Property

Provides access to the list of predefined date ranges that are available in date range parameters’ editors in Print Preview.

Namespace: DevExpress.XtraReports.Parameters

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

NuGet Package: DevExpress.Printing.Core

Declaration

public static Dictionary<string, Func<Range<DateTime>>> PredefinedDateRanges { get; }

Property Value

Type Description
Dictionary<String, Func<Range<DateTime>>>

The dictionary of predefined ranges that are available in parameters’ editors.

Remarks

The list of predefined date ranges stored in the PredefinedDateRanges property is displayed in the date range parameter editor in Print Preview.

When you make changes to the predefined date ranges, the changes become available in the date range parameter editor.

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. The code also clears the list of predefined date ranges and adds the September and October predefined ranges to the parameter’s editor.

A user specifies a start date and an end date. The custom **September** and **October** date ranges are available.

Note

This code is in effect for WinForms and WPF End-User Reporting Applications only.

using DevExpress.XtraReports.Parameters;
using DevExpress.XtraReports.Expressions;
// ...
// Remove all predefined ranges and add two new date ranges.
RangeParameterEditorOptions.PredefinedDateRanges.Clear();
RangeParameterEditorOptions.RegisterDateRange("September", () => new DateTime(2019,9,1), () => new DateTime(2019,9,30));
RangeParameterEditorOptions.RegisterDateRange("October", () => new DateTime(2019,10,1), () => new DateTime(2019,10,31));
See Also