Progress® Telerik® Reporting R1 2021

New to Telerik Reporting? Download free 30-day trial

Watermarks

Watermarks are text or pictures that appear commingled with the report content. They often add interest or identify status, such as marking a generated report as a Draft. You can see watermarks in Print Preview Layout of the report viewers and when printing or exporting. You have the ability to set the Opacity of the text or image, specify its Position and whether it is displayed on first (PrintOnFirstPage) and last page (PrintOnLastPage).

Watermarks are PageSettings member, processed during the paging of the report. At this moment the report data source is not available anymore, and thus data fields used in expressions would not be evaluated.

Add Text Watermark using Report Designer

To add Text Watermarks to the Report use the following steps:

  1. Open a report in Design view.

  2. You can open the Watermarks collection editor in two ways:

    • Click the Report selector button located in the upper left corner of the Visual Studio Report Designer. This makes the report active in the Properties window. Expand PageSettings and click Watermarks ellipsis in the property grid.

    • Select the Watermarks item in the report's context menu, which appears when you right-click on the designer surface.

    Both actions will display the Watermarks collection editor, which is empty by default.

  3. Click Add button and select TextWatermark.

  4. In Text, type or click the ellipsis to enter text or an Expressions that represents the Text Watermark.

  5. Format the text by setting Color and Font attributes.

  6. Set Opacity.

  7. Set Position. Available options are Behind and Front. Default is Behind.

  8. Set Orientation. Available options are Horizontal, Vertical and Diagonal. Default is Horizontal.

  9. Specify whether it will be displayed on first (PrintOnFirstPage) and last page (PrintOnLastPage).

  10. Click OK.

Add Text Watermark programmatically

Telerik.Reporting.Drawing.TextWatermark textWatermark1 = new Telerik.Reporting.Drawing.TextWatermark();
textWatermark1.Color = System.Drawing.Color.Red;
textWatermark1.Font.Bold = true;
textWatermark1.Font.Italic = false;
textWatermark1.Font.Name = "Arial";
textWatermark1.Font.Size = Telerik.Reporting.Drawing.Unit.Point(10D);
textWatermark1.Font.Strikeout = false;
textWatermark1.Font.Underline = false;
textWatermark1.Orientation = Telerik.Reporting.Drawing.WatermarkOrientation.Diagonal;
textWatermark1.Position = Telerik.Reporting.Drawing.WatermarkPosition.Behind;
textWatermark1.PrintOnFirstPage = true;
textWatermark1.PrintOnLastPage = true;
textWatermark1.Text = "My Test Watermark";
textWatermark1.Opacity = 0.3D;
report1.PageSettings.Watermarks.Add(textWatermark1);

Add Picture Watermark using Report Designer

To add Picture Watermarks to the Report use the following steps:

  1. Open a report in Design view.

  2. You can open the Watermarks collection editor in two ways:

    • Click the Report selector button located in the upper left corner of the Visual Studio Report Designer. This makes the report active in the Properties window. Expand PageSettings and click Watermarks ellipsis in the property grid.

    • Select the Watermarks item in the report's context menu, which appears when you right-click on the designer surface.

    Both actions will display the Watermarks collection editor, which is empty by default.

  3. Click the small arrow on the right side of the Add button and select PictureWatermark from the drop-down menu.

  4. In Image, browse for an image file on your hard drive, input an URI (local path or URL) or an Expressions that evaluates to an image. The Image field also accepts a string that represents a Base64-encoded image.

  5. Set Sizing mode. Available options are Center, Stretch, ScaleProportional and TopLeft. See PictureBox article for more information on the modes.

  6. Set Opacity.

  7. Set Position. Available options are Behind and Front. Default is Behind.

  8. Specify whether it will be displayed on first (PrintOnFirstPage) and last page (PrintOnLastPage).

  9. Click OK.

Add Picture Watermark programmatically

Telerik.Reporting.Drawing.PictureWatermark pictureWatermark1 = new Telerik.Reporting.Drawing.PictureWatermark();
pictureWatermark1.Image = "http://www.telerik.com/images/reporting/cars/NSXGT_7.jpg";
pictureWatermark1.Position = Telerik.Reporting.Drawing.WatermarkPosition.Behind;
pictureWatermark1.PrintOnFirstPage = true;
pictureWatermark1.PrintOnLastPage = true;
pictureWatermark1.Sizing = Telerik.Reporting.Drawing.WatermarkSizeMode.ScaleProportional;
pictureWatermark1.Opacity = 0.5D;
report1.PageSettings.Watermarks.Add(pictureWatermark1);

Add Background Overlay using Report Designer

Background Overlay is a special kind of Picture Watermark that is designed to facilitate the creation of form type reports. It is rendered behind the report contents and takes the whole page area without respecting the page margins.

To add Background Overlay to the Report use the following steps:

  1. Open a report in Design view.

  2. You can open the Watermarks collection editor in two ways:

    • Click the Report selector button located in the upper left corner of the Visual Studio Report Designer. This makes the report active in the Properties window. Expand PageSettings and click Watermarks ellipsis in the property grid.

    • Select the Watermarks item in the report's context menu, which appears when you right-click on the designer surface.

    Both actions will display the Watermarks collection editor, which is empty by default.

  3. Click the small arrow on the right side of the Add button and select BackgroundOverlay from the drop-down menu.

  4. In Image, browse for an image file on your hard drive, input an URI (local path or URL) or an Expressions that evaluates to an image. The Image field also accepts a string that represents a Base64-encoded image.

  5. Set Sizing mode. Available options are Center, Stretch, ScaleProportional and TopLeft. The Background Overlay sets TopLeft as its default Sizing value, which means the image will be displayed without being resized, and positioned in the top left corner of the page area. See PictureBox article for more information on the modes.

  6. Set Opacity. By default the Opacity of the Background Overlay is set to 1.

  7. Specify whether it will be rendered in the output report document. The default value is false which means the Background Overlay will be visible only during design-time.

  8. Specify whether it will be displayed on first (PrintOnFirstPage) and last page (PrintOnLastPage). These options are overridden by the RenderInReportDocument option, i.e. if it is set to false, the PrintOnFirstPage and PrintOnLastPage options will not be respected.

  9. Click OK. The design surface should display the selected Background Overlay image.

Add Background Overlay programmatically

Telerik.Reporting.Drawing.BackgroundOverlay backgroundOverlay1 = new Telerik.Reporting.Drawing.BackgroundOverlay();
backgroundOverlay1.Image = "http://www.telerik.com/images/reporting/cars/NSXGT_7.jpg";
backgroundOverlay1.PrintOnFirstPage = true;
backgroundOverlay1.PrintOnLastPage = true;
backgroundOverlay1.Sizing = Telerik.Reporting.Drawing.WatermarkSizeMode.TopLeft;
backgroundOverlay1.RenderInReportDocument = true;
backgroundOverlay1.Opacity = 1D;
report1.PageSettings.Watermarks.Add(backgroundOverlay1);

Add Watermark conditionally

Add Watermarks to the Report on even pages only:

  • For Text Watermark, in Text property, use the following expression: =IIF(PageNumber %2 = 0, "My Text Watermark", null)

  • For Picture Watermark, in Image property, use the following expression: =IIF(PageNumber %2 = 0, "C:\MyImageWatermark.png", null)

Add Watermarks to the Report via defined page range:

  • For Text Watermark, in Text property, use the following expression: =IIF(PageNumber > 2 and PageNumber < 10, "My Text Watermark", null)

  • For Picture Watermark, in Image property, use the following expression: =IIF(PageNumber > 2 and PageNumber < 10, "C:\MyImageWatermark.png", null)

Design-time support

For better design experience, the watermarks are shown in the designer by default. They can be switched on/off with the watermarks button, located on the toolstrip at the bottom left corner of the designer window.

report-designer-toolstrip-watermarks-focused

The value of the text watermarks is not evaluated and it is shown 'as-is' in the designer. Note that the position of the watermark in design-time is calculated based on the report size in designer and might differ from the watermark you will see in the previewed report.

The value of the picture watermark is evaluated against the designer context and will be shown if possible.

Some formats do not support Watermarks. For more information refer to the articles in the Design Considerations for Report Rendering section

In this article
Not finding the help you need?