7.2.1  Parameterizing a Condition

As explained in Filtering Data in Data Binding Wizard, you can restrict the data that is displayed by a report element (e.g., table, chart, text) by adding filtering conditions to the Condition tab of the 'Data Binding' dialog box. The example in Walkthrough: Adding Conditions in Data Binding Wizard illustrates how to add a fixed condition, i.e., a condition that is fully specified at design-time and that performs the same filtering operation each time the report is generated. In addition to such fixed conditions, you can also create adaptive conditions, i.e., conditions which can be modified at runtime.

To create an adaptive condition on a report element, follow the steps below.

To specify a condition on an exiting report element, see Filtering Data in a Table.

1. Select the Condition tab of the 'Data Binding' dialog box. (See Filtering Data in Data Binding Wizard for information on the 'Data Binding' dialog box.)

2. Use the menus to specify the first part of the condition. For example, for binding to the sample 'All Sales' query, you could create the following condition:

[Employee][is][equal to]

3. To use a variable in the condition, click the “arrow” button at the right side of the condition, and select the 'Variable' option. Then follow the steps below:

 

a. In the adjacent 'Name' field, enter a name for the parameter. (For example, enter “stateVar” as the parameter name.)

See Defining and Editing Report Parameters to set the variable data type.

This is the name (case sensitive) by which you will refer to the parameter in hyperlinks, scheduled tasks, and scripts. If the condition operator is “one of”, then the variable represents an array. Otherwise, it is a scalar value.

b. Enable 'Use Selection List' if you want to prompt the end user with a list of available choices for the parameter. (The choices are drawn from the conditionalized data field, e.g., Customer.State.)

Note that the adjacent menu automatically chooses the 'equal to' or 'one of' operator to match your selection.

3. To use session data in the condition, click the “arrow” button at the right side of the condition, and select the 'Session Data' option.

In the menu, choose one of 'User', 'Roles', or 'Groups'. These parameters return information about the user who is currently accessing the report; respectively, the user name, the array of roles to which the user belongs, and the array of groups to which the user belongs.

4. Click 'Append'. This adds the new condition to the 'Clauses' panel. For the above example, the following clause is added:

[Customer.State][is][one of][$(stateVar)]

 

5. Click 'Finish' to close the 'Data Binding' dialog box, or continue making other data binding modifications as described in Creating a New Table, Crosstab, or Section using a Wizard.

By default, users will be prompted during report loading to enter a value for the specified variable. The variable name that you enter in the 'Name' field of the condition is used as the label in the user prompt unless you provide an alternate label for this purpose. See Defining and Editing Report Parameters to set a variable label and to enable or disable user prompting.

The value of a variable can also be acquired from sources other than user input. See Acquiring a Parameter Value for the available alternatives.

<< 7.2 Parameterization © 1996-2013 InetSoft Technology Corporation (v11.4) 7.2.2 Defining and Editing Report Parameters >>