What if you wanted to run a custom report created in Crystal Reports
separately for each location, and wanted to automate the location
selection making it as easy and foolproof as possible? This is where
Parameter Fields would come to the rescue. The Parameter Fields can be
incorporated into a selection formula and will give you a chance to
choose the location you want to run the report on.
For example, you could be prompted to enter an exchange rate to be
used to convert a currency each time you run a custom report. Or, you
may want to allow an option for a date range to be used on an activity
report.
To demonstrate this feature, let’s start with an existing report
that provides a roster of assets and presents some basic information.
This report, Parameter Fields Demo, lists the assets by system number,
and includes description, location, internal acquired value, Internal
Year to Date (YTD) Depreciation, and the Custodian. The report pulls
all assets with an activity code of “A” (Active). The design screen of
this report is presented below:

Note: You need to have an existing report to add the Parameter Field.
This report has already been created using Report Writer, and is
ready for editing in the Design tab of Crystal Reports®. This is where
the Parameter Fields will be added.
This report is run for the sample company, Westfield Bakery – Demo.
Westfield Bakery has a number of locations: Bakery, Store 1, Store 2,
and Store 3. We will use the Parameter Fields to select the location
the report will cover.
First, create the Parameter Fields. From the Design tab in Crystal Reports, select Insert, then select Field Object from the drop-down menu. Or, select the Insert Field button
from the Tool Bar. The Field Explorer dialog box will appear:

Select the Parameter Fields, and click the New button
. The Create Parameter Fields dialog box will appear:

The top part of the Parameter Fields dialog box determines a number of items.
The first is the Name: field, in which we’ll enter Location_Name_Prompt.
The second is the Prompting text: field, which
determines what question or statement will be presented as a prompt to
users when they are entering the value. In this case we’ll enter the
question, What is the Location you need?
The third is a Value type: field., which is defaulted to String
in the drop-down menu. Since the location will be a text field, it will
be left as the default. There are other choices, such as Date and
Number, which could be selected if needed.
Date would be used if you are selecting for a placed-in service date or a current-thru date.
Number would be used for a numeric value like accumulated depreciation or acquired value.
Once these values are filled in, the Parameter Field is created, and the dialog box will look like this:

The lower part of the dialog box gives some additional options. A
useful one is to set some default values to reduce the possibility of
keystroke errors. To enter a default, click the Set Default Values button. The Set Default Values dialog box will appear.

To set a default value for Location_Name_Prompt, select the Asset Information entry from the Browse table: drop-down menu. Then, select location from the Browse field: drop-down list. This will display all the values for location under the Select or enter value to add: field. Select the desired value as a default and click the > button. This will transfer the value to the Default Values/Description field. You can select multiple values, or transfer them to the Default Values/Description field as a group by clicking the >> button. Transferring multiple values over will create a drop-down menu for the users.

Once that is done, Click the OK button to return to the Create Parameter Fields dialog box. Clicking the OK button will return you to the Field Explorer dialog box, which will now look like this:

Note that Location_Name_Prompt now appears under Parameter Fields. Click the Close button to return to the Design tab.
Now that the Parameter Fields for Location_Name_Prompt has been created, it needs to be incorporated into the report’s selection criteria. This is accomplished through the Select Expert in Crystal. Navigate to the Report from the top menu bar, and choose Select Expert from the drop-down menu:

This will display the Select Expert dialog box,
which is an easy way to edit the selection formula. Since the report
does not have any reference to Location, click the New… button on the right, and select Location from the Asset Information Table. Select is equal to from the drop-down menu, and select the newly created Parameter Fields, which will appear as {?Location_Name_Prompt} in the drop-down menu. Remember that Location_Name_Prompt is the name given to the Parameter Fields. The Select Expert dialog box should look like this when you have finished:

Then click the OK button to return to the Design tab and save the report.
Now you are ready to run the report. After launching the report, click either the Print Preview or the Refresh button from the toolbar. The following dialog box will appear:

This is where the value for the Parameter Fields is set. You will recognize Location_Name_Prompt. The prompting question (What is the Location you need?), and the default list, which appears in the Discrete Value
drop-down menu. Select the desired location from the drop-down menu (or
multiple locations, since you can select more than one) and click the Add button. The chosen value(s) will appear in the Value box. For this example, Store #1 is selected. Click the OK button, and the report for the selected location will appear in the Crystal Preview tab.

If a report for another location is needed, click the Refresh button on the toolbar, and select a different value for the Location_Name_Prompt Parameter Fields.
This automation is a powerful feature of Crystal Reports and can tremendously simplify selecting assets for reports. Inserting Parameter Fields
into Custom Reports is an easy way to increase the usefulness of these
reports, without sacrificing the ease of using them. This power can be
used as another way to maximize the value of Sage FAS to your business.
with
no comments