Previous TopicNext Topic


How to create a data set parameter

This procedure assumes you already inserted a parameter marker in the SQL query.

If you create multiple data set parameters, create them in the order in which their corresponding parameter markers appear in the WHERE clause.

  1. In Data Explorer, choose the data set for which you want to create parameters.
  2. Edit Data Set displays the query for the data set. The following illustration shows a query with one parameter marker in the WHERE clause.

  3. Choose Parameters.
  4. Edit Data Set displays default parameter information in the first row.

  5. Create a data set parameter by specifying the following required values:
    1. In the first row, in Name, type a name for the parameter.
    2. In Data type, select a data type for the parameter.
    3. In Direction, choose Input. This value means that the parameter is an input parameter.
    4. In Default value, type a default value.
    5. The default value is passed to the WHERE clause of the query if there is no report parameter bound to this data set parameter. You must specify a default value and it must be a valid JavaScript expression. For example, if most reports display records with Active as a particular column's value, you can set the default value of the data set parameter to "Active". Enclose the default value in double quotation marks (" ") if you specified String or Date Time as the data type.
      If you want the query to return all rows for a particular column when verifying the query results, specify "%" as the default value. For most SQL databases, % is a wildcard character that matches any sequence of characters. To specify "%" as the default value, you must meet two requirements:
      • The corresponding clause in the query must use LIKE, which is a pattern matching option. For example:
      • WHERE state LIKE ? 
        
      • The data set parameter must be set to string type.
    The following illustration shows the settings used to create a data set parameter called custState. The parameter's default value is "MA".

  6. Repeat step 3 to create additional data set parameters for any other parameter markers you inserted in your SQL query.
  7. When you finish creating your data set parameter or parameters, choose Preview Results to verify that the query returns rows that match your WHERE condition.
  8. Preview Results shows the rows that match the WHERE condition. The following illustration shows the results of the previous example. It shows all rows for customers in MA, the default value specified by the data set parameter.

  9. To save the data set parameters, choose OK.

(c) Copyright Actuate Corporation 2006

Previous TopicNext Topic