Prepending and appending PDF files to a ForNAV report
To add PDF’s before and after the output of a DataItem (for example: an invoice) you can use the Append and Prepend JavaScript functions using a BLOB field with the PDF as parameter.
The PDF’s can be stored in any table with a BLOB field. However, the easiest way to do this is to use the ForNAV File Storage page to import the PDF’s and create JavaScript records for each of them in the layout:
After that you can add code in the OnPreReport JavaScript trigger. In this example the ‘A’ PDF is prepended and the ‘B’+’C’ PDF’s are appended to each Sales Header:
CurrReport.DataItems.Header.Pdf.Prepend(A.Data);
CurrReport.DataItems.Header.Pdf.Append(B.Data);
CurrReport.DataItems.Header.Pdf.Append(C.Data);
And the result is this:

Latest news
Latest knowledge base articles
-
AI Assistant in the ForNAV Designer (beta)
-
Mapping from Business Central documents to ZUGFeRD and XRechnung
-
Using native Business Central ZUGFeRD generation with FORNAV reports
-
Repeater tables and barcodes in the ForNAV Template Editor
-
Controlling report language, format region, copies, and watermark with the Report Settings page

