beautypg.com

Defining sort order using parameter fields – HP Intelligent Management Center Standard Software Platform User Manual

Page 630

background image

6.

Create a formula using the parameter field as you would any constant
value. For example, rather than creating a formula that hard-codes the
country name:

{customer.COUNTRY} = "USA"

Use a parameter field instead of "USA".

{customer.COUNTRY} = {?Country}

To do this double-click the database field, press =, then double-click the
parameter.

Tip:

Identify parameter fields easily by looking for (?).

7.

Click Save and Close on the Formula Workshop.

The Field Explorer dialog box appears. The name of the formula you have
just created is highlighted in the Formula list box.

8.

Drag and drop the formula into the report.

9.

Click Refresh to generate the report.

A dialog box appears, prompting you for values.

Defining sort order using parameter fields

To set the sort order using parameter fields, you need to first create a formula
that includes a parameter field and then sort based on that formula. For
example, assume that you have a customer list report based on the Customer
table. For each customer, you show the Customer Name, City, Region,
Country, and Phone Number. You want to be able to sort the report by
Country, by Region, or by City, depending on your needs at the time.

1.

Create a parameter field and call it SortField.

2.

Select String from the Type list.

You may want to limit the number of characters the user can type to one.

3.

To do this, type the numeral 1 into the Min Length and Max Length text
boxes and click OK.

630

Crystal Reports 2008 SP3 User's Guide

Parameter Fields and Prompts

23

Advanced parameter features