ONYX - 9.0 - Utilisation
Document footer management in XML
Sommaire
Introduction
This section describes how to manage fixed-height document footers on the last page of a document with automatic page breaks.
Prerequisites
- Have a good foundation on how Designer works in XML mode
- Know the structure of the XML Designer file
Problematic
When a document contains a long list spread over several pages and having a footer only on the last one (document footer), it is generally desirable that the list takes up all the space available on the intermediate pages, but that it stops early enough on the last to leave room for the footer of the last page.
Principle
To meet this need, it is necessary to intervene on 2 elements:
- Condition the document footer so that it appears only on the last page. To do this, the condition to use is “Page break” with not(1) logic. Indeed, this condition becomes true for the rest of the page as soon as a paginated group triggers a page break. For this condition to be relevant, it must therefore be evaluated after processing the group corresponding to the paginated list. The document footer must be created exclusively with “group” or “text” type objects, because these are the only ones that can be executed after a “group” type object.
- Artificially integrate the document footer at the end of the list so that the latter can take it into account when triggering page breaks It is essential to ensure that the document footer has enough space on the last page . The group corresponding to the paginated list must therefore check that this space is available. If this is not the case, a page break must be triggered before writing the document footer. To do this, a specific (artificial) line must be added at the end of the main group. This line will be used to reserve a space whose height will be at least equivalent to that of the document footer.
Example
The idea is to use the following group as a document footer. In our example, the XML has a special line at the end of the main group named RESA_SPACE. We apply a zone with a front spacing of 3cm. (this allows you to reserve the place for the document foot)
<group name="Products"> <line >….</line> <line >….</line> <line >….</line> (...) <line name=”RESA_SPACE/> </group>
We condition the RESA_SPACE zone on the presence of the line type "RESA_SPACE"
In our case, the document footer is 2 tables (VAT breakdown and totals table)
This includes all the elements required to design the VAT breakdown table of a document. This must only be present on the last page of the document.
The group must be conditioned on not triggering a page break: