Create and Manage Active Report Variables

Create active report variables to allow controls in a report to interact with each other. Active report variables pass information from one control to another control.

About this task

You can also create active report variables when you define connections between controls. However, you may want to modify these variables, such as changing the name or defining default values.

In addition, active report variables allow active reports inserted in a workspace in IBM® Cognos® Workspace to interact with each other. For example, selecting a product line in one active report causes another active report to show the data for the selected product line. In addition, variables allow check boxes and sliders in a workspace in Cognos Workspace to drive active reports in the workspace.

To work in Cognos Workspace, active report variables must meet the following criteria:

  • The variables must be public.

    When you make a public variable, the variable can be consumed in other IBM Cognos products.

  • For active reports to listen to each other in a workspace, each report must have a public variable with the same name.
  • For a Cognos Workspace slider to drive an active report, a range variable must be defined in the active report.

    The data item of the slider and the range variable in the active report must have the same name.

    Two variables are used to define the minimum and maximum values of the range variable. The two variables are used to define the minimum and maximum values of the slider.

Procedure

  1. Click the Queries icon Queries icon and then click the Active Report variables icon Active Report Variables tab.
  2. Create a variable by following these steps:
    1. Click Create a new variable.
    2. In the Name box, type the name of the variable.
    3. Click the Data Type drop-down menu and click the type of variable that you want to create.
    4. To make the variable public, select the Public (External) check box.
    5. If you want to specify a default value for the variable, click Set default values and define or specify the values that you want.

      If you have added a control to the active report, the Variable Values Source drop-down menu becomes active.

      To define your own default values, in the Variable Values Source list, click Enter Value(s), and then click the new icon Add button icon..

      To specify default values that come from a data item in a control, in the Variable Values Source list, click Select Value(s). Specify the control and the data item from which you want to select default values, and then select the values that you want from the Values box.

      Tip: Define multiple default values when you want more than one item selected in a control that allows multiple selections, such as a check box group.
  3. To modify an existing variable, right-click the variable and click Edit variable.
  4. To add a default value, click Set default values.

    To change a default value, click the name of the current default value specified for the variable.

  5. Create a range variable by following these steps:
    1. Create the variables that will define the minimum and maximum values of the Cognos Workspace slider.

      The variables must have the number data type.

      Tip: Range variables are automatically set as public variables. Do not make the variables that are used to define the minimum and maximum values of the slider public.
    2. Click Manage ranges.
    3. Click the new icon Add button icon..
    4. In the Name box, type the name of the range variable.
    5. Click the Minimum Variable list and select the variable that will be used to set the minimum value of the slider.
    6. Click the Maximum Variable list and select the variable that will be used to set the maximum value of the slider, and then click OK twice.
      Note: If you later delete the minimum or maximum variable, the range variable is also deleted.