Advanced report design

Linked querys

A subreport can have only a main dataset, but you can open as many datasets as you want, and you can link this datasets to the main dataset or to other dataset linked to the main dataset. You can also use the child subreport property of a section to merge subreports.

For example:

To link a dataset with another dataset you must select the property Master Dataset. A linked dataset must have parameters, the name of the parameters must be the same as the field names of the linked dataset.

Here is a sample:

When you assign a main dataset to a subreport, this subreport, prints the details once for each record. So while printing a subreport, if the main dataset has a linked query , it will be updated, for example if the custno field in the main dataset changes and the linked query is parametrized with this field, the linked query will change, and the new field values will be available to print.

Note: With the BDE driver you can link Tables by selecting the correct IndexFields and Master Fields properties like you do in Delphi or Builder.