Mastering Business Analysis with Crystal Reports 9 (Wordware Applications Library)

While this date parameter is useful, it's somewhat limiting. Only records that match the exact order date entered by report users displays. A better option is to create a date parameter that uses a date range. Date ranges are nice in that they allow users to select all records for a period of time that they define — be it a week, month, quarter, year, etc. Date range parameters are the most common found in reports.

Creating date ranges isn't much different from the creation of a single date parameter. In the Field Explorer, right-click on the Order Date parameter. Select Edit from the options menu. The Edit Parameter Field dialog box displays.

From this dialog box, change the following:

Your screen should look like Figure 11-12.

Figure 11-12: Changing a date parameter to allow for date ranges

Once you've done this, press the OK button. A Enter Parameter Values dialog box displays, asking you to enter the range of dates that you wish the report to display. Enter 01/01/2000 to 01/01/2001, as shown in Figure 11-13, and press OK.

Figure 11-13: Entering date range values

Your report displays, only showing records with an order date between the date specified. Figure 11-14 displays the results of your work. Save these changes to your EmplOrders.rpt file.

Figure 11-14: A report with a date range parameter

Категории