|
|
|
|
|
- Overview
- Creating a watermark from the report viewer
- Creating a watermark through programming
- Method 1: Full configuration: using a Watermark variable
- Method 2: Quick configuration: direct use
Printing a watermark text
A report (and a duplicate copy) can include an additional text in the format of a watermark, such as "Confidential" or "Duplicate" printed across the report. The watermark can be created: - from the report viewer (WINDEV only).
- programmatically.
Remarks: - If a watermark is defined for a report, it is defined for all the pages of the report.
- A single watermark can be defined for each report. You cannot define several watermarks.
- The watermark is printed on the pages containing information only. It is not printed on empty pages.
Creating a watermark from the report viewer Creating a watermark through programming Different methods can be used to create a watermark through programming: Method 1: Full configuration: using a Watermark variable This method is as follows: - Define a Watermark variable. This variable contains all the characteristics of the watermark to print.
- Use iParameterWatermark to add the watermark into your report.
- Start printing the report.
For example: - WLanguage code used to print a watermark in the background of a report created with the report editor:
// Print a watermark in report background MyWatermark is Watermark  // Text of the watermark MyWatermark.Text = "Confidential" // Font used MyWatermark.Font.Name = "Arial" // The watermark will be horizontally centered at bottom MyWatermark.Position = iCenterH + iBottom  // Print in the report viewer iDestination(iViewer)  // Indicates that the watermark will be printed during the print // and in the duplicate copies iParameterWatermark(iWatermarkPrinting + ... iWatermarkDuplicate, MyWatermark)  // Starts printing the report iPrintReport(RPT_Commercial)
- WLanguage code used to print a watermark in the background of a report created with the print functions:
MyWatermark is Watermark  // Text of the watermark MyWatermark.Text = "Confidential"  // Print in the report viewer iDestination(iViewer)  // Implement a watermark in document background only iParameterWatermark(iWatermarkPrinting, MyWatermark)  // Prints several pages with watermark FOR i = 6 TO 10 iPrint(" Page " + i) iSkipPage() END // The last page is empty and it has no watermark  // Ends the print job iEndPrinting()
Method 2: Quick configuration: direct use This method is as follows: - Use iParameterWatermark to specify the text of the watermark that will be added into your report. In this case, the "Arial" font is used, with an automatic size and with an opacity set to 20%.
- Start printing the report.
For example: - WLanguage code used to print a watermark in the background of a report created with the report editor:
// Print in the report viewer iDestination(iViewer) Â // Indicates that the watermark will be printed during the print // and in the duplicate copies iParameterWatermark("Confidential") Â // Starts printing the report iPrintReport(RPT_Commercial)
- WLanguage code used to print a watermark in the background of a report created with the print functions:
// Print in the report viewer iDestination(iViewer)  // Implement a watermark in document background only iParameterWatermark(iWatermarkPrinting, "Confidential")  // Prints several pages with watermark FOR i = 6 TO 10 iPrint(" Page " + i) iSkipPage() END // The last page is empty and it has no watermark  // Ends the print job iEndPrinting()
Related Examples:
|
Training (WINDEV): WD Reports
[ + ] This example presents the different methods for creating a report: - prints based on different data sources (queries, variables, ...) - prints based on controls (Table, Spreadsheet, PVT, ...) - printing composite reports - specific prints (portrait/landscape, report with watermark, report with bar code, ...)
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|