Skip to content

Commit 5c5b289

Browse files
author
Natalia Kazakova (DevExpress)
committed
time-range parameters
1 parent 39ee71b commit 5c5b289

File tree

10 files changed

+40
-14
lines changed

10 files changed

+40
-14
lines changed

reporting-for-desktop/articles/report-designer/report-designer-for-winforms/use-report-parameters/date-range-report-parameters.md

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,53 @@ author: Sergey Andreev
55

66
# Date Range Report Parameters
77

8-
This topic describes how to create a date range parameter and filter a report's data by the specified dates.
8+
This topic describes how to create **date range** and **time range** parameters and filter a reports data by the specified date or time values.
99

10-
![A date range parameter's editor in Preview](../../../../images/eurd-win-date-ranges-parameters-panel.png)
10+
![A date range parameter's editor in Preview](~/reporting-for-desktop/images/use-date-ranges-parameters-panel.png)
1111

1212
## Create a Date Range Parameter in the Report Designer
1313

14-
Follow the steps below to add a date range parameter to a report in the [Report Designer](../../report-designer-for-winforms.md):
14+
Follow the steps below to add a range parameter to a report in the [Report Designer](../../report-designer-for-winforms.md):
1515

16-
1. [Create a report parameter](create-a-report-parameter.md) and set the **Value Source** option to **Range Parameters**. The **Start Parameter** and **End Parameter** sections appear, and you can configure options in these sections to create a date range.
16+
1. [Create a report parameter](create-a-report-parameter.md).
17+
2. In the *Add New Parameter* dialog, specify parameter options:
18+
19+
- **Parameter type**: *Date and Time*, *Date*, or *Time*
20+
- **Value Source**: *Range Parameters*
21+
22+
The **Start Parameter** and **End Parameter** sections that appear allow you to configure options to create a date or time range:
1723

18-
![add-parameter-dialog](../../../../images/use-date-ranges-design-add-param-dialog.png)
24+
![The "Add new parameter" dialog for a range parameter](~/reporting-for-desktop/images/use-date-ranges-design-add-param-dialog.png)
1925

20-
2. Set the name and initial value for the **Start Parameter** and **End Parameter**. To specify an [expression](../use-expressions.md) instead of a static value, click the **Value** option's ellipsis button and use the **Expression Editor** dialog.
26+
3. You can change the *Name* and initial static *Value* for the **Start Parameter** and **End Parameter**. To specify an [expression](../use-expressions.md) instead of a static value, the **Value** option's ellipsis button and use the **Expression Editor** dialog:
2127

22-
![value-expression](../../../../images/use-date-ranges-design-value-expression.png)
28+
![The "Add new parameter" dialog for a range parameter - Expression](~/reporting-for-desktop/images/use-date-ranges-design-value-expression.png)
2329

24-
After you create a date range parameter, you can reference the names of the **Start Parameter** and **End Parameter** in the report's filter string to [filter the report's data](../shape-report-data/filter-data/filter-data-at-the-report-level.md) by the created date range. Select the report, click the **FilterString**'s ellipsis button in the **Properties window**, and construct a filter condition in the invoked **FilterString Editor**.
30+
4. [Reference the created range parameter](reference-report-parameters.md). You can reference this parameter in the reports filter string, in expressions, and in a control's **Text** property. You can also bind control and data source parameters to report parameters.
2531

26-
![filterstring](../../../../images/use-date-ranges-filterstring.png)
32+
We recommend that you use the following functions with range parameters in expressions and filter strings:
2733

28-
When you switch to the report's **Print Preview** tab, the [Parameters panel](parameters-panel.md) displays the date range parameter. After you submit a start and end date, the report document shows filtered data.
34+
- `InDateRange(Date, FromDate, ToDate)` - equivalent to the `FromDate <= Date && Value < Date` expression.
35+
- `InTimeRange(Time, FromTime, ToTime)` - equivalent to the `FromTime <= Time && Time < ToTime` expression (including cases where the range spans midnight, such as 23:00-01:00).
36+
- `OutOfTimeRange(Time, FromTime, ToTime)` - equivalent to the `FromTime > Time || Time => ToTime` expression (including cases where the range spans midnight, such as 23:00-01:00).
2937

30-
![A date range parameter's editor in Preview](../../../../images/eurd-win-date-ranges-parameters-panel.png)
38+
The image below filters the report's data by the following filter string:
3139

32-
The start and end parameter values store the selected day's midnight time. For instance, if you choose _10/15/2019_, the *DateTime* value is _10/15/2019 12:00:00 AM_. If your date fields include non-midnight times, records for the end date _10/15/2019_ are excluded from the report. To include data for the 10/15/2019 date, use the **GetDate()** function in the **FilterString Editor**.
40+
`InDateRange([ShippedDate], ?paramDateRange_Start, ?paramDateRange_End) `
3341

34-
![Filter String - GetDate](../../../../images/eurd-win-date-ranges-filterstring-getdate.png)
42+
![Reference the created range parameter in the filter string](~/reporting-for-desktop/images/use-date-ranges-filterstring.png)
43+
44+
45+
When you switch to the report's **Print Preview** tab, the [Parameters panel](parameters-panel.md) displays the newly created range parameter. Click the editor to set a range. The editor type depends on the parameter type:
46+
47+
**An editor for "Date" and "Date and Time" range parameters:**
48+
49+
![A date range parameter's editor on Print Preview.](~/reporting-for-desktop/images/use-date-ranges-parameters-panel.png)
50+
51+
**An editor for "Time" range parameters:**
52+
53+
![A time range parameter's editor on Print Preview.](~/reporting-for-desktop/images/use-time-ranges-parameters-panel.png)
54+
55+
After you submit start and end values, the report document shows filtered data. The report below shows the **ShippedDate** field filtered by the date range parameter:
56+
57+
![The report data is filtered by the date range](~/reporting-for-desktop/images/use-date-ranges-parameters-filtered.png)
Binary file not shown.
Binary file not shown.
-10.2 KB
Loading
-1.12 KB
Loading
11.7 KB
Loading
23.6 KB
Loading
20.7 KB
Loading
15.3 KB
Loading

reporting-for-web/articles/report-designer/use-report-parameters/date-range-report-parameters.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ This topic describes how to create a date range parameter and filter a report's
99

1010
![A date range parameter's editor in Preview](../../../images/eurd-web-date-ranges-parameters-panel.png)
1111

12+
> [!Note]
13+
> Web Report controls do not support `Date` and `Time` range parameters. You can only create a range parameter of `Date and Time` type.
14+
1215
## Create a Date Range Parameter in the Report Designer
1316

1417
Follow the steps below to add a date range parameter to a report in the [Report Designer](../first-look-at-the-report-designer.md):
@@ -31,4 +34,4 @@ When you switch to the report's **Print Preview** tab, the [Parameters panel](pa
3134

3235
The start and end parameter values store the selected day's midnight time. For instance, if you choose _10/15/2019_, the *DateTime* value is _10/15/2019 12:00:00 AM_. If your date fields include non-midnight times, records for the end date _10/15/2019_ are excluded from the report. To include data for the 10/15/2019 date, use the **GetDate()** function in the **FilterString Editor**.
3336

34-
![Filter String - GetDate](../../../images/eurd-web-date-ranges-filterstring-getdate.png)
37+
![Filter String - GetDate](../../../images/eurd-web-date-ranges-filterstring-getdate.png)

0 commit comments

Comments
 (0)