User`s guide
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.
21.12.6 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.
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; otherwise, 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}
2012-03-14483
Parameter Fields and Prompts