- 12 Jan 2024
- 2 minute read
- Print
- DarkLight
- PDF
Adding a Header or Footer to Documents in a Document Export Query
- Updated 12 Jan 2024
- 2 minute read
- Print
- DarkLight
- PDF
Prerequisite Skills
Sometimes a third-party system requires document metadata to be included on the document itself (as opposed to being in an associated index file). To accomplish this, the required information must be added to the pdf:xml export in the Document Export query. Using the Configurable Joins - Document base this can be accomplished by creating the pdf:xml export using a Subquery Export.
Building the Standard Parts of the pdf:xml Subquery Export
Start by recreating the standard portions of the pdf:xml export.
Important!
These steps must be followed exactly for the Document Export query to function as intended.
In the Exports section, next to the Export button, select the subquery button. An Edit Part popup appears.
Set the following configurations:
Name: pdf:xml
Output: XML
Node: batch
In the Exports area, click the Export button. An Insert Query Part popup appears.
In the Direct Exports section, under the Document category, select Record GUID.
Click Continue. The export now appears on the Edit Part popup.
Hover over the Document Record GUID export and select the edit (pencil) icon. An Edit Part popup appears.
Change the Name value to "@id" and click Save. The export is renamed on the Edit Part popup.
In the Exports area, to the right of the Export and subquery export buttons, click the Literal button. An Edit Part popup appears.
Set the following values:
Name: @mode
Literal: stream
In the Exports section, click the Export button. An Insert Query Part popup appears.
In the Direct Exports section, under the Document category, select Scope.
Click Continue. The export now appears on the Edit Part popup.
Hover over the Document Scope export and select the edit (pencil) icon. An Edit Part popup appears.
Change the Name value to "@scope" and click Save. The renamed export appears on the Edit Part popup.
In the Exports section, click the Export button. An Insert Query Part popup appears.
In the Direct Exports section, under the Document category, select XML.
Click Continue. The export now appears on the Edit Part popup.
Hover over the Document XML export and select the edit (pencil) icon. An Edit Part popup appears.
Change the Name value to "node()" and click Save. The renamed export appears on the Edit Part popup.
Add an @header Attribute with Desired Metadata
Before adding the @header attribute to your pdf:xml export, consider which datapoints need to be included and ensure that the joins to access these datapoints are configured appropriately. Refer to our Configurable Joins - Joining documentation as needed.
Important!
Though we are adding an @header attribute to our pdf:xml export, this data will display only within the footer of the resulting document.
1. Open the pdf:xml Subquery Export created above.
2. Add a nested Subquery Export by selecting the Subquery icon next to the Export button
Name: @header
Output: Concatenate
3. Add the desired datapoints with literal separators as needed for readability.
4. Save the @header nested subquery export.
5. Reorder the exports within the pdf:xml subquery export so that the node() export is at the bottom.
6. Save the pdf:xml subquery export.