Switch to: V12V11V10V9V8V7V6V5

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.

auto_size

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.

This property is checked by default. If you want to define the height of the region manually you must uncheck it.

Examples

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.

remove_empty_line

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.

remove_empty_line has the following possible values:

  • Don't Remove – Space is left intact.
  • In Area – A line from left to right in this region must be free from other controls to be removed.
  • In Group – A line from left to right must be free from grouped controls to be removed, mostly useful with property position_type=Float In Group.
  • Everywhere – A line from left to right on the page must be free from other controls to be removed.

Previously, before version 11.2.8, it was a boolean option, now it's equivalent is remove_empty_line=In Area.

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 a part of the decoration, so if some space is going to be removed, these decoration controls are ignored.

This approach doesn't work for all controls, and in many cases, it was not possible to eliminate free space if hidden control was on the same line with other controls.

In version 11.2.8 it is also possible to use remove_empty_line=In Group and position_type=Float In Group properties for this purpose.

Examples

1. remove_empty_line = Don't Remove

Text in the middle is not printed and empty space is preserved.

2. remove_empty_line = In Area

Text in the middle is not printed, an empty line is removed.

3. remove_empty_line = In Area, for multiple controls

Space reserved for two controls laying on the same line with remove_empty_line=In Area property is removed.

4. remove_empty_line = true, decoration size_type = No Stretch

The space for two controls is not removed due to the 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.

6. remove_empty_line = In Area, position_type = Float

Hidden control is located on the same line with visible, so its empty space can't be used.

7. remove_empty_line = In Group, position_type = Float In Group

For controls in group position_type is set to Float In Group – the control is hidden and its place occupies the next control laying below.

8. A set of 10 factors is grouped into two columns, some factors are equal to 0.

  • Let's hide factors equal to 0 using the print_if property.

As you can see there is a lot of empty space.

  • Remove empty space reserved for hidden factors using remove_empty_line property

Note, not all of the empty space was removed – hidden factors are not on the same line.

  • Group columns of controls and set position_type=Float In Group for them