Table of Contents
Report Editor - Removing Empty Space
There are two cases when Valentina Reports engine can remove unused space from the report:
- Free space at the top or at the bottom of the report region. It is removed using the auto_size property of the appropriate region.
- Free space reserved for controls hidden with e.g. print_if or print properties. The remove_empty_line property of such hidden controls is used for it.
The auto_size region property allows the report engine to automatically remove an empty space at the top or at the bottom of the region.
1. auto_size = false
The region contains empty space on layout and preview.
2. auto_size = true
As you can see a free space was removed and records go one by one.
Each control on report has remove_empty_line property. If a control is not going to be printed (e.g. due to print_if or print properties) a place it occupies can be optionally removed using remove_empty_line.
If a few controls laying on the same line are empty and has remove_empty_line property checked the empty space is removed as well.
A complete line from left to right in this region must be free from other controls in order to be removed.
But if there is some decoration (e.g. rectangle or line) on the same line – such line can't be removed by default.
To solve it, it is necessary to distinguish which elements are a part of the decoration. There is such a property – size_type, if it is set to Relative To Region – control changes its height depending on the height of the region it lays in. Such control is considered as a part of the decoration, so if some empty space is going to be removed, these decoration controls are ignored.
1. remove_empty_line = false
Text in the middle is not printed and empty space is preserved.
2. remove_empty_line = true
Text in the middle is not printed, an empty line is removed.
3. remove_empty_line = true, for multiple controls
Space reserved for two controls laying on the same line with checked remove_empty_line property is removed.
4. remove_empty_line = true, decoration size_type = No Stretch
The space for two controls is not removed due to rectangle around (the line is not free and can't be removed).
5. remove_empty_line = true, decoration size_type = Relative To Region
With property size_type = Relative To Region the rectangle is considered as a part of decoration so doesn't prevent removing an empty line anymore.