Adding different watermarks to each page
Sometimes you want to have different watermarks in the report output. To do this, you use the ReportForNav.Watermark.Image.Load(fromStream) function.
It is important that you call the function before the report runtime starts printing a new page (because the watermark will be printed before that). If you call the function on a section trigger on a header document, the watermark is only printed on the next page. Instead, you must call the function from the OnPreDataItem or a footer trigger on the previous page.
For example: one watermark on the first page and another one on the other pages:
List – OnAfterGetRecord()
IF (ReportForNav.PageNo = 1) THEN
WatermarkFile.OPEN(‘C:Nav FilesA.pdf’)
ELSE
WatermarkFile.OPEN(‘C:Nav FilesB.pdf’);
WatermarkFile.CREATEINSTREAM(WatermarkStream);
ReportForNav.Watermark.Image.Load(WatermarkStream);
WatermarkFile.CLOSE;
The function can also be used to append different PDF documents to a data item. The ForNAV AppendPdf function adds the same PDF to all data items but by printing out a blank page and using the ReportForNav.Watermark.Image.Load(fromStream) function for that page and loading a blank watermark after it has been printed, you can append a different PDF document for each record.
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
