Printing hierarchy |
Top Previous Next |
A "Data" band allows printing a hierarchical list. For this, one band and one data source are used. Hierarchy must be defined in the data source with the help of two data columns:
In order to print such a source in a hierarchical form, you need to set the following "Data" band properties. This can be done in the "Properties" window:
Let us look at an example of how to print a hierarchy of employees from the "Employees" demo table. The table has got two columns which we need:
Create a report that looks like the following:
Set the "Data" band properties, which is responsible for the hierarchy, in the following way:
When we run a report, we will see the following:
When printing hierarchy, FastReport shifts the band to the right (by a value indicated in the Indent property), and also decreases the band width by the same value. This allows you to use the Anchor property of band's objects. Here is possible values for this property that can be used in this case:
It allows you to get some useful effects:
In this example, the picture object has Anchor property set to Left, Top; the object with job title is anchored to Left, Right, Top; the object with the name is anchored to Right, Top. |