AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / Editores / Editor de reportes / Crear un reporte mediante programación
  • Overview
  • Creating a watermark from the report viewer
  • Creating a watermark programmatically
  • Method 1: Full setting: using a Watermark variable
  • Method 2: Quick setting: direct use
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Overview
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 programmatically
Different methods can be used to create a watermark through programming:

Method 1: Full setting: using a Watermark variable

This method is as follows:
  1. Define a Watermark variable. This variable contains all the characteristics of the watermark to print.
  2. Use iParameterWatermark to add the watermark into your report.
  3. 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 duplicates
    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 setting: direct use

This method is as follows:
  1. 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%.
  2. 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 duplicates
    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()
Versión mínima requerida
  • Versión 17
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 05/11/2024

Señalar un error o enviar una sugerencia | Ayuda local