:

    Advanced Structures

    Hierarchies

    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]( “Special Reporting Techniques”) section.

    For the example below, an additional data band must be added and the data source tDomains must be assigned.

    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.

    Docusnap-Report-Designer-Text-Editor-Expression-Relations

    Docusnap-Report-Designer-Data-Source-Relations

    Hierarchies: Relations

    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 Docusnap-Report-Designer-Relation 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.

    Docusnap-Report-Designer-tDomains-Host

    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.

    Docusnap-Report-Designer-Data-Setup-relation

    Showing Types in Multiple Languages

    • Since Docusnap uses two languages, all types are stored in English and German. In the database structure, two additional tables are used for this purpose besides the table that contains the actual data: The Type table contains the name and the TypeText table contains the name in English and German.

    • For each report, Docusnap creates the LanguageID variable. This variable contains either 0 for German or 1 for English, depending on the language that has been selected for this report. By means of this variable, the types can be shown in the desired language.

    • In order to show the type text, the SQL statement for the data source needs to be modified. Example of the new SQL statement based on the Host type:

    Select tHosts.*, TypeText as Type
    from tHosts, tHostTypes, tHostTypeText
    where tHosts.HostTypeID = tHostTypes.TypeID and tHostTypes.TypeID =  tHostTypeText.TypeID and
    LanguageID = {LanguageID}
    
    • To add the additional column, click the Retrieve Columns button.

    Docusnap-Report-Designer-Edit-Data-Source-Multilanguage

    • Then, copy the text boxes for the text and the heading. Finally, you can edit the heading and the selected column, if required.

    Docusnap-Report-Designer-Multilanguage-Type-Band