In Docusnap, you can represent parent-child relationships between the tables. The dependencies between the tables can be implemented using relations or parameters. The parameters are explained in the Special Reporting Techniques section.
In the example below, we assume that an additional data band is required to which the tDomains data source will be assigned. First, add a Docusnap shape. For this purpose, use the Shape_Title_Level1 style.
Then, create a text box for the domain name output. For the title, always use a single text box. In the Text Editor, enter "Domain" and add the DomainName column. The style to be used is Title_Level1.
When you create a report, you will define all required relations. For a child data band, you need to select the relation and the parent data band as the master component.
In this report, the computers will be assigned to the domains. In the generated report, the first domain is shown in the first place, followed by all associated computers. Then, the next domain is shown with its associated computers, and so forth. In order to obtain this structure, a relation must be defined between the two data bands. Relations that exist in the database are also loaded into the Report Designer. Relations that do not exist can be created now. Relations always consist of a master component and a detail component. The detail component is the band that contains the data that will be associated. In this example, the data band with the computers will be used as the detail component. The master component is the data band that contains the domains. Relations will always be associated to the detail component. For this reason, enter the relation for the tHosts table. The icon indicates a relation. The name of the relation is composed of the name of the table for the master component and the name of the table for the detail component. In this report, the relation is named tDomainstHosts.
When you double-click the computers data band, the Data Setup dialog opens. There, you can select the desired relation. Click the Relation button to display all relations defined for this table. In this case, only one relation is listed: the relation with the tDomains table. Select the tDomainstHosts relation. Double-clicking a relation will select it and close the dialog. If you only click the relation once to select it, the dialog remains open. To make additional settings, select the relation using a single click.
Next, select the master component. The master component indicates the band on which this relation depends. The relation only represents the connection between the tables. If a report includes multiple bands, make sure to select the appropriate name. The name of the data band is displayed on the left in its blue title bar. In this report, there is only one other data band. Select this data band. Click the OK button to apply the relation and the master component to the detail component.
Select tHosts.*, TypeText as Type
from tHosts, tHostTypes, tHostTypeText
where tHosts.HostTypeID = tHostTypes.TypeID and tHostTypes.TypeID = tHostTypeText.TypeID and
LanguageID = {LanguageID}