Hierarchical Reports
2 minute read
Listing the Directory Structure
The directories of all computers in the domain are stored in the tDirectories table. A folder that does not have a parent directory will be identified by the value -1. For each other folder, the DirectoryID of its parent folder is listed in the Parent column. This enables you to build a hierarchy. This hierarchy will be created in the Report Designer using a hierarchical data band.
Hierarchical Data Band
When you add a hierarchical data band, the Data Setup dialog opens. For this report, select the tDirectories table. Then, specify the criteria to build the hierarchy. On the Properties tab, set the Key Data Column property to DirectoryID and the Master Key Data Column property to Parent. The parent value identifies the “parent” of the top folder. If you do not enter a value for this property, this column, identifying the parent record, must be empty for the top level directory in the hierarchy.
For the Indent property, specify the number of millimeters for indenting the next level. If only the first text box should be indented, the Locked property must be set to True for the remaining fields. Using the Headers and Footers properties, you can select the header band and the footer band to be shown before each hierarchy level.
Parent Value
In addition to a number, the primary key or a column from another table may be specified as the parent value. However, this value cannot be entered in the Parent Value property on the Properties tab, but rather must be defined as an event. Select the page by clicking the white margin or an area of the page that does not have a band.
Switch to the Events properties by clicking the button on the Properties tab. The parent value can be defined using the Begin Render property. When assigning, first specify the name of the hierarchical band and then use .ParentValue to get the parent value. Finally, assign the desired value using the equals sign (=). In this report, it is called DcReportHierarchicalBand1.
Finally, you can add text boxes for user input.