ONYX - 9.0 - Utilisation

Document footer management in XML

De MappingDoc
Révision datée du 2 janvier 2025 à 13:05 par Jdieu (discussion | contributions) (Page créée avec « #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 bec... »)
Autres langues :
English • ‎français

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:

  1. 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.
  2. 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

Reservation of space for the document footer

The idea is to use the following group as a document footer. In our example, we have 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>


Resafooter1.png


We condition the RESA_SPACE zone on the presence of the line type "RESA_SPACE"


Resafooter2.png


Management of the appearance of the document footer

In our case, the document footer is 2 tables (VAT breakdown and totals table)


Pied de document.png


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 conditional on not triggering a page break:
Pieds de page cond.png