Child bands
Child Bands
When we need that parts of the band have different properties, we divide it into several bands. The first one remains the same, and the rest are subordinate to it (Child band). Many such bands are on the report '241 - Invoice' that can be find in menu 'Goods | Issue'. On this report we can find many bands which have different conditions for visibility. Conditions are in this case defined in the script. Child bands are also used in the case when on the band is an object whose height changes, and the distance to the lower objects must remain the same. Each child band, except the last one must have assigned the "Child" property, its value is the name of the next child band in the group. Also parent band of the first child band in the group must have assigned the "Child" property. If we want that next child bands in group can be visible (if it suits condition for visibility) you must enabled the "PrintChildIfInvisible" property of child and on the parent band.
Let's look an example!
There can be a problem when one field in a report has content of variable length. To simulate this in our example, let's reduce the width of the Bio.“Common Name” object to 2.5 cm and enable the “Stretch” property for this object and also for the “First level data” band. Enable all the frame lines for all the objects so that the effects of the stretching function are clear to see. The design now outputs a report like this:

Here the first Bio.“Common Name” field object contains a lot of text and is stretched into two lines. This causes the Bio.“Length (cm)” field object, located beneath it, to be shifted downwards. This happens because all the objects have their "ShiftMode" property set to "smAlways" by default, meaning they shift downwards if there is a stretchable object (a “Text” object with the “Stretch” property enabled) above them. The distance shifted depends on how much the object above is stretched.
But this is not want we want to happen on our label - we want the “Length, cm.” object also to be shifted by the same amount. This can be achieved by using a special FastReport band type called the “Child” band. A “Child” band is linked to (and displayed after) its parent band. Add a “Child” band to the design and drag the two “Text” objects into it, as shown here:

Link the MasterData band to the Child band, by setting its “Child” property to “Child1” in the Object inspector. Now, each time the MasterData band prints, the Child band is printed immediately after it:

The “Length, cm:” title now lines up exactly with its value field “50”. To prevent a child band from being moved to the next page if there is insufficient white space on the page (and becoming so-called 'orphaned' from its parent band), enable the “KeepChild” property of the parent band in the Object inspector.