Defining entry type and format using the edit mask – HP Intelligent Management Center Standard Software Platform User Manual

Page 631

Advertising
background image

Now the parameter field will only accept single-character values. The field
will accept "C" as a value, but not "City."

4.

In the Prompting Text field, enter a prompt similar to this:

Type R to sort by Region or C to sort by City; other
wise, data will be sorted by Country.

5.

Create a formula similar to this and call it Sort:

If {?SortField} = "C" Then {customer.CITY}
Else

If {?SortField} = "R" Then {customer.REGION}
Else

{customer.COUNTRY}

This formula prompts for a value for the parameter field {?SortField}. If
you enter "C", the formula will sort by the City field. If you enter "R" it will
sort by the Region field. If you enter anything else, or do not enter anything
at all, the formula will sort by the Country field.

For more information see "If statements" in the online help.

6.

Place the formula in the Report Header section of the report and

select Suppress (No Drill-Down) in the Section Expert so that it does
not print.

7.

Click Sort Records.

8.

Choose your formula and click Add.

9.

Click OK.

Now when you run the report, the program will prompt you for a sort field,
the formula will return a value based on your selection, and the sort facility
will use that value as your sort field.

Defining entry type and format using the Edit Mask

1.

On the View menu, click Field Explorer.

2.

Select Parameter Fields and click New.

The Create New Parameter dialog box appears.

3.

Enter the Name and value Type.

Crystal Reports 2008 SP3 User's Guide

631

23

Parameter Fields and Prompts

Advanced parameter features

Advertising