Reporting

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

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. Click the Report selector button located in the upper left hand of the Visual Studio Report Designer. This makes the report active in the Properties window.
  3. Expand PageSettings and click Watermarks ellipsis in the property grid. This displays the Watermarks collection. By default, the collection is empty.
  4. Click Add button and select TextWatermark.
  5. In Text, type or click the ellipsis to enter text or an Expressions that represents the Text Watermark.
  6. Format the text by setting Color and Font attributes.
  7. Set Opacity.
  8. Set Position. Available options are Behind and Front. Default is Behind.
  9. Set Orientation. Available options are Horizontal, Vertical and Diagonal. Default is Horizontal.
  10. Specify whether it will be displayed on first (PrintOnFirstPage) and last page (PrintOnLastPage).
  11. Click OK.

Add Text Watermark programatically

CopyC#
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);
CopyVB.NET
Dim textWatermark1 As 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(10.0)
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.3
report1.PageSettings.Watermarks.Add(textWatermark1)

Add Picture Watermark

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. Click the Report selector button located in the upper left hand of the Visual Studio Report Designer. This makes the report active in the Properties window.
  3. Expand PageSettings and click Watermarks ellipsis in the property grid. This displays the Watermarks collection. By default, the collection is empty.
  4. Click Add button and select PictureWatermark.
  5. 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.
  6. Set Sizing mode. Available options are Normal, Stretch and ScaleProportional. See PictureBox article for more information on the modes.
  7. Set Opacity.
  8. Set Position. Available options are Behind and Front. Default is Behind.
  9. Specify whether it will be displayed on first (PrintOnFirstPage) and last page (PrintOnLastPage).
  10. Click OK.

Add Picture Watermark programatically

CopyC#
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);
CopyVB.NET
Dim pictureWatermark1 As 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.5
report1.PageSettings.Watermarks.Add(pictureWatermark1)

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)
Caution

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