Streachable objects
Stretching Objects
Let's consider a case when we have multi-line text of varying length. The "Text" object displaying the information from this field has a fixed size. This is why some lines appear to be cut off. What can be done about this?

Of course, either the size of the object could be increased or its font size could be reduced. However, this may lead to wastage of space on the output page as some fish have long descriptions, while others have short ones. FastReport has some properties which allow us to resolve this problem.
These properties allow a band or an object to automatically adjust its height to create the necessary space for a given record (row). To achieve this, we just need to enable the “Stretch” property of both the band and the “Text” object. However, that is not quite all, because a “Text” object with longer text should be able to stretch by itself we’ll need to set some of its other properties too.
The “Text” object can automatically set its height and width to make space for its contents. “AutoWidth” and “StretchMode” can be used for this. “AutoWidth” allows the “Text” object to vary its width so that all the lines make space without splitting any words. This mode is useful when an object has a single text line and when growth to the right will not effect other objects. The “Stretch” property allows the object’s height to grow to accommodate the text without changing the object's width. "Stretch" has several modes which can be selected in the object inspector:
smDontStretch – do not stretch the object (the default)
smActualHeight – stretch the object so it makes room for the whole text
smMaxHeight – stretch the object so that its bottom reaches the bottom of the band in which it is placed - we'll look at this mode later on
Here we are interested in the “Stretch” property of the “Text” object. Enable it using the object's context menu or by setting "StretchMode" to smActualHeight. Also enable the band's “Stretch” property. Preview the report and make sure that everything is now as expected.
To flow text into new line we use property "Word Wrap" must be enable what is already the default value. This property in meaningful if "AutoWidth" property is enabled.
As you can see, when constructing the report FastReport fills objects with data and stretches them if “Stretch” is enabled. It then computes the band’s height so each object has enough room. If the band's “Stretch” property is disabled, this height adjustment is not performed and the band is displayed at the height set in the design. In this case we would see that the objects with longer text would still be stretched but the band would not, which leads to overlaying of text, since the following band is displayed immediately after the previous one.
Page Breaks
When a report is created the FastReport engine fills the white space of the page with the bands. After displaying each band the current position shifts down. When FastReport finds that there is not enough white space left to display the next band (its height is larger than the white space left on the page) FastReport creates a new page and carries on with band display from there. This sequence continues for as many times as there are records in the dataset.
Our report contains an object with large text, which is why the band height is quite large. Furthermore, if a large band does not have enough place on a page it is shifted to the next one leaving a lot of unused space remaining at the bottom of the page, as shown here:

To limit paper wastage, let's use a FastReport feature that makes paragraphs from a band’s contents. All we need do is enable the “AllowSplit” property of the “First level data” band. You will see that there is now less white space at the bottom of the report pages:

How does this band splitting work? There are some objects in FastReport which support this feature. They are the “Text”, “Line” and “RichEdit” objects. They can be “split”, while other objects cannot. When FastReport needs to split a band, it does it in the following way:
- displays the non-splittable objects which have room in the white space
- partially displays splittable objects (“Text” objects are displayed in a way that all lines have space in the object)
- creates a new page and continues with object display in the band
- if a non-splittable object does not have room in the white space, it is shifted to the next page; at the same time all the objects located beneath it are shifted as required
- the process continues until all of the band objects are fully displayed.
The splitting algorithm will become clearer by looking at this example:

It should be noted, that the splitting algorithm is not perfect and the final output may not be quite as expected. You should use this option very carefully in cases where objects on the split band are grouped in a complicated way, and/or their font sizes differ. Here is an example of what could be generated:

Shifting Objects
Let's look to the different modes of shifting. For this puproses we use the “ShiftMode” property. Let's look at the 'smWhenOverlapped' mode of shifting. In this mode object shifting occurs when the object above stretches and overlaps the object below. Here are two secenarios:
1: the three top objects have “Stretch” enabled and the three bottom objects have “ShiftMode” set to 'smAlways'. The bottom objects only shift far enough to allow space for the stretched object above it:

2: the three top objects have “Stretch” enabled and the three bottom objects have “ShiftMode” set to 'smWhenOverlapped'. The bottom objects shift to allow space for the stretched object and also to maintain the designed separation of the two objects:

This allows the creation of complicated reports, in particular where an object could overlap several other objects above it at the same time. In the example below all the upper objects contain stretchable text and all the lower ones are in 'smWhenOverlapped' mode. The lower objects will always be displayed close to the object above, irrespective of text length in the objects above:
