I'm trying to understand how to control run-time vertical spacing, especially with embedded sub-reports which can display a variable number of records.
I'm also confused by the terms 'Stretch' and 'Split' as used in the Jaspersoft documentation. Either I don't understand them, or they don't work as expected. To me 'Stretch' is like stretch-jeans, they get bigger when you put your legs in. Then there's a 'split' if things get too big inside. LOL. Ok, enough kidding, what do these terms mean in the Jaspersoft context?
I'm already familair with the ability to vertically flow data from a variable number of input records with MS Access, HTML, Word, LibreOffice Writer, etc. So I'm hoping for similar functionality in Jaspersoft. It seems to work only some of the time. In Access for example, almost all controls have 'Can Grow' and 'Can Shrink' options to control page flow:
* When Can Grow is true, and if there is more content then the bounding box grows larger, and everything below it is pushed down.
* When Can Shrink is true, and if there is less content, or none, then the bounding box shrinks smaller, and everything below it scoots up.
In HTML you can fix the size of a <div> .. </div> container, or you can let it's content determine the size. Everything that follows below it depends on it's run time vertical size.
Does Jaspersoft have this sort of functionality, and if so how does one control it? For example a sub-report's appearance properties have "Stretch Type", but I can't seem to make this do anything. (I'm working on a sub-report with 1 to 4 possible lines in my Title band.)
Bonus points if you will say what these mean under Size:
Stretch type: No Stretch Relative to Talles Object (depreciated) Relative to Band Height (depreciated) ElementGroupHeight ElementGroupBottom ContainerHeight Container Bottom
First, use Position Type: Fixed to Top and the control will stay put and not be pushed down if things above it overflow. Or set it to Float to allow it to be pushed down by things above getting bigger. Fixed to Bottom is similar to Fixed to Top.
Next, splitting appears to refer to how data is split, from one page to the next. It's discussed in The jasperreports-library-ultimate-guide page 118, in PREVENTING BAND SPLIT.
In some cases it is desirable to keep the whole contents of a given band in one piece to
prevent page breaks when the band stretches beyond its initial specified height. To do
this, use the splitType attribute, as follows:
Split stretched content: The band never splits within its declared height. The band
will not start rendering on the current page if the remaining available space is not at
least equal to the band's declared height. However, if the band stretches on the
current page, the region that is added to the original height is allowed to split onto
the next page ( splitType="Stretch" ).
Prevent split on first attempt: The band starts to render normally, but if the bottom
of the page is reached without finishing the band, the whole contents of the band
that are already being laid out are moved to the next page. If the band does not fit
on the next page, the split occurs normally, as band split prevention is effective
only on first split attempt ( splitType="Prevent" ).
Split immediately: The band is allowed to split anywhere except above its topmost
element ( splitType="Immediate" ).
If a split type is not specified, the default is given by the
net.sf.jasperreports.band.split.type configuration property.
|Specifies the element stretch behavior relative to its element group siblings or element container stretch.|
|Base Type: string|