Passing Parameters to a Report

A Parameterised report contains parameters, either user-defined or passed directly from a report's dataset.

Report parameter values can be either hard-coded into a report or requested from users in Print Preview.

Report parameters can be employed in numerous tasks. They may be used in a report's filter string and a calculated field's or formatting rule's expression.

How to Create a Report with Parameters

To simplify this example, you will pass a single integer parameter, and request it each time the report is previewed. You can specify as many parameters as required in your report and they may be of any type (e.g. date-time, boolean, string, double, and so on).

Exercise - Create a Report with Parameters

  1. Create a new blank report or open an existing report.
  2. Fill in the Name and Description for your report.
  1. Click on Substitution Parameters and click the plus sign to add a substitution parameter. Fill in the form as shown below:
  2. This form sets up the substitution parameter to read in a value from a drop-down list.

  1. Click on Data Sets and click the plus sign to add the dataset for the report.
  2. Fill in the form as shown below:
  3. This form returns the data from the gb_site table to the report where the input substitution parameter is checked against the possible values for the project field.

    The user may choose from a drop-down list of potential projects.

  1. Create labels and perform the data binding for the Project and SITE_ID fields in the report's Detail band.
  2. Add a group header entry and the page numbers as shown below.
  1. Save your work, close all open windows and return to the Advanced Reporting node.

View the Result

  1. Execute the report. Enter the value for the Project (Exploration) in the Substitution Parameters form and click OK.
  2. Switch to the Preview tab to see the report output.
  3. The report output consists of data which has a value for the PROJECT field which is equal to the parameter value (Exploration in this case) inserted.

Concept Link IconSee Also