RangeParameterEditorOptions Class
A static class that provides access to the list of predefined ranges that are displayed in the date range parameter‘s editor in Print Preview.
Namespace: DevExpress.XtraReports.Parameters
Assembly: DevExpress.Printing.v24.1.Core.dll
NuGet Package: DevExpress.Printing.Core
Declaration
Remarks
Date range parameters are used in reporting applications. The date range parameter editor provides a list of predefined ranges that users can select from.
Use the RangeParameterEditorOptions static class in WinForms and WPF applications to customize the list of predefined value ranges. The following members allow you to manipulate the predefined ranges:
- The RangeParameterEditorOptions.PredefinedDateRanges property stores the list of predefined date ranges. The list is available in the date range parameter editor in Print Preview.
- The RangeParameterEditorOptions.RegisterDateRange method adds an item to the list of predefined ranges.
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.
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));