You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: reporting-for-desktop/articles/report-designer/report-designer-for-winforms/use-report-parameters/date-range-report-parameters.md
+36-13Lines changed: 36 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,30 +5,53 @@ author: Sergey Andreev
5
5
6
6
# Date Range Report Parameters
7
7
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 report’s data by the specified date or time values.
9
9
10
-

10
+

11
11
12
12
## Create a Date Range Parameter in the Report Designer
13
13
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):
15
15
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:

19
25
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:

23
29
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 report’s filter string, in expressions, and in a control's **Text** property. You can also bind control and data source parameters to report parameters.
We recommend that you use the following functions with range parameters in expressions and filter strings:
27
33
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).
29
37
30
-

38
+
The image below filters the report's data by the following filter string:
31
39
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**.

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
+

50
+
51
+
**An editor for "Time" range parameters:**
52
+
53
+

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
+

Copy file name to clipboardExpand all lines: reporting-for-web/articles/report-designer/use-report-parameters/date-range-report-parameters.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,9 @@ This topic describes how to create a date range parameter and filter a report's
9
9
10
10

11
11
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
+
12
15
## Create a Date Range Parameter in the Report Designer
13
16
14
17
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
31
34
32
35
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**.
0 commit comments