Supplying retrieval arguments to relate a nested report to its base report

The most efficient way to relate a nested report to its base report is to use retrieval arguments. If your nested report has arguments defined, you use the procedure described in this section to supply the retrieval argument value from the base report to the nested report. (The procedure described is part of the whole process covered in “Placing a related nested report in another report”.)

Why retrieval arguments are efficient

Some DBMSs have the ability to bind input variables in the WHERE clause of the SELECT statement. When you use retrieval arguments, a DBMS with this capability sets up placeholders in the WHERE clause and compiles the SELECT statement once. DataWindow Designer retains this compiled form of the SELECT statement for use in subsequent retrieval requests.

Requirements for reusing the compiled SELECT statement

To enable DataWindow Designer to retain and reuse the compiled SELECT statement:

NoteNested reports in composite reports If the base report is a composite report, you need to define retrieval arguments for the composite report before you can supply them to the nested report.

In the Properties window for the composite report, select the General category. Then define the retrieval arguments that the nested report needs, taking care to specify the correct type.

StepsTo supply a retrieval argument value from the base report to the nested report:

  1. Make sure that the nested report has been set up to take one or more retrieval arguments.

    See “Placing a nested report in another report”.

  2. Select the report and click the ellipsis button next to the Nest_Arguments property.

  3. Supply the base report column or the expression that will supply the argument’s value. To do this, double-click the Expression column.

    The Modify Expression dialog box displays. In this dialog box, you can easily select one of the columns or develop an expression. In the example, the column named id from the base report will supply the value for the argument :customerid in the nested report.

    When you run the report now, you are not prompted for retrieval argument values for the nested report. The base report supplies the retrieval argument values automatically.