| Search Locate Previous Next | Contents |
NB This function may be removed in future versions of NewLeaf. It is generally better handled using the header and footer properties of the table.
It is sometimes necessary to keep several items together as a unit, for example:
Subheading
Table
Caption for table
If you are generating a report automatically from a data file, you may not know in advance how many items are in the table, and the logic to ensure that a page-break does not occur in the middle of the group is complex!
Each call to leaf.Group defines the next n items (paragraphs, tables, charts, pictures) as a collection which will only be broken if the length of the entire set exceeds one page. For example ...
leaf.Group 3 'sub' leaf.Place 'Subheading' leaf.table.List mat leaf.Place 'Table Caption'
When you call leaf.Group it inserts a soft pagebreak at that point in the report and starts counting down from the value you give. The counter is decremented whenever it completes an element such as a paragraph, table or rule. If it attempts a pagebreak when the counter is non-zero it will back up to the most recent soft break and redo the elements which follow (setting the counter to zero to prevent an infinite loop).
Note that you can include the Group property in a paragraph style, which gives a simple way to implement Keep together (Group 1) and Keep with Next (Group 2) automatically.