BackPrevious Page Next PageNext

Referencing Parameters in a Join Condition

Using parameters in join conditions of data source pre-joins and query joins can dynamically change query results at runtime. It works similarly as query filters. In a join condition, you can select a parameter, or manually input a parameter name in the format @ParameterName or :ParameterName. See the following example.

  1. Open the catalog file SampleReports.cat in <install_root>\Demo\Reports\SampleReports.
  2. In the Catalog Manager, create a type-in parameter in Data Source 1, which is named pCountry of String type with two values: Canada and Italy.

    New Parameter dialog

  3. Right-click the ShipmentDetailsbyCustomer query in Data Source 1 and select Edit Query.
  4. In the Query Editor, double-click the join icon join button in the join line.
  5. In the Join Options dialog, click Add Condition to add a new condition line. In the second condition line, click the first Choose button to select the Country field by double-clicking it from the Values dialog, then click the second Choose button to select the parameter pCountry. Click OK in the Join Options dialog.

    Join Options dialog

  6. Click OK in the Query Editor and then save the catalog.
  7. Create a page report based on the ShipmentDetailsbyCustomer query in Data Source 1.
  8. View the report result and you will be prompted to enter the parameter value for pCountry. Select Italy and the report shows only data of Italy.

BackPrevious Page Next PageNext