Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
CRW_REF.PDF
Скачиваний:
5
Добавлен:
13.02.2015
Размер:
13.99 Mб
Скачать

Parameter field prompts can be up to two lines long with approximately 40-50 characters per line (depending on character width, up to 255 character limit). The program performs automatic word wrap on prompts more than one line long.

A parameter field can have only one default value.

You can use parameter fields in compiled reports to prompt for record selection criteria that you normally would not be prompted for in a compiled report. In this way, the program gives you the opportunity to specify values in compiled report selection formulas that contain fields and operators only. But if you place a parameter field in your selection formula, the program will prompt you for its value, even if that value is not a field.

HANDS-ON (Parameter Field Objects)

This section includes Hands-On tutorials for performing a number of different tasks using parameter fields. How to create a parameter field, Page 394, How to use a parameter field in a formula, Page 398, and How to respond to parameter field prompts, Page 399, are sequential; they provide an overview of a typical process using parameter fields. The remaining tutorials can be read individually, as needed.

How to create a parameter field

Click the INSERT FIELDS button on the standard toolbar. The Insert Fields dialog box appears. Click the Parameter Tab to activate it.

394

Seagate Crystal Reports User’s Guide

2 Click the New button.

!The Create Parameter Field dialog box appears. Enter the following information into the fields provided:

Parameter Name: Enter the name you want to use to identify the parameter field.

Prompting Text: Enter the text you want to appear when the program prompts you.

Value Type: Enter the data type of the parameter field.

Default Prompting Value: Enter the value you want the program to use if you do not supply a new value.

Browse Table: Use this drop-down box to specify a default table.

Browse Field: Use this drop-down box to specify a default field.

Your dialog box should look like this:

Parameter Fields

395

"Click OK to return to the Insert Fields dialog box. The new parameter field is name displayed in the Parameter Fields list.

How to set record selection using parameter fields

You can easily use parameter fields for record selection. In this example, you will create a parameter field that selects regions to include in the report.

To get started, create a report using the Customer table in CRAZE.MDB, and place the following fields from left to right in the Details section:

{customer.CUSTOMER NAME} {customer.LAST YEAR’S SALES}

With the Insert Fields dialog box still active, click the Parameter Tab to activate it.

3 Click the New button.

The Create Parameter Field dialog box appears.

396

Seagate Crystal Reports User’s Guide

"Enter the following information into the corresponding edit boxes:

Type “Region” in the Parameter Name text box.

Type “Enter the region you would like to see sales for” in the Prompting Text text box.

Select String from the Value Type drop-down box.

Type “CA” in the Default Prompting Value drop-down box.

Select Customer from the Browse Table drop-down box.

Select Region from the Browse Field drop-down box.

#Click OK. You are returned to the Insert Fields dialog box. The parameter field you just created now appears in the list box.

$Click the SELECT EXPERT button on the standard toolbar. The Choose Field dialog box appears.

% Select Region and click OK. The Select Expert appears.

&Leave the first drop-down box set to is. Choose equal to from the second drop-down box. A third drop-down box appears.

'Click the arrow on the drop-down box to display the list of regions. The prompting variable that you created now appears at the top of the list.

Select the prompting variable from the list and click OK.

Parameter Fields

397

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]