XRWatermark Class
A watermark in a report.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v20.2.dll
NuGet Packages: DevExpress.Reporting.Core, DevExpress.WindowsDesktop.Reporting.Core
Declaration
Remarks
Use the XtraReport.Watermark property to access an XRWatermark object and its members.
See Add Watermarks to a Report for information on how to add a watermark to a report at design time.
Example
This example demonstrates how to add a watermark to a report. The SetTextWatermark method demonstrates the properties you can use to add a text watermark to a report; the SetPictureWatermark method demonstrates properties required to set a picture as the report’s watermark.
using System.Drawing;
using DevExpress.XtraPrinting;
using DevExpress.XtraPrinting.Drawing;
// ...
public void SetTextWatermark(XtraReport report) {
Watermark textWatermark = new Watermark();
textWatermark.Text = "CUSTOM WATERMARK TEXT";
textWatermark.TextDirection = DirectionMode.ForwardDiagonal;
textWatermark.Font = new Font(textWatermark.Font.FontFamily, 40);
textWatermark.ForeColor = Color.DodgerBlue;
textWatermark.TextTransparency = 150;
textWatermark.ShowBehind = false;
textWatermark.PageRange = "1,3-5";
report.Watermark.CopyFrom(textWatermark);
}
public void SetPictureWatermark(XtraReport report) {
Watermark pictureWatermark = new Watermark();
pictureWatermark.ImageSource = ImageSource.FromFile("Watermark.png");
pictureWatermark.ImageAlign = ContentAlignment.TopCenter;
pictureWatermark.ImageTiling = false;
pictureWatermark.ImageViewMode = ImageViewMode.Stretch;
pictureWatermark.ImageTransparency = 150;
pictureWatermark.ShowBehind = true;
pictureWatermark.PageRange = "2,4";
report.Watermark.CopyFrom(pictureWatermark);
}
Implements
DevExpress.Printing.Utils.DocumentStoring.IStorableObject
DevExpress.Utils.Serializing.Helpers.IXtraSupportShouldSerialize
Inheritance
Object
DevExpress.Printing.Utils.DocumentStoring.StorableObjectBase
PageWatermark
Watermark
XRWatermark
See Also