watermark

hi,
how can I add watermark at runtime to previewPage?
I want to use it for demo version

thanks

Comments

  • edited 11:58PM
    I found it

    Watermark watermark = new Watermark();
    watermark.Enabled = true;
    watermark.Text = "Demo Version";
    ReportPage page = reportObject.Pages.OfType<ReportPage>().First();
    page.Watermark = watermark;

    thanks
  • edited 11:58PM
    Thanks! This really helped me a lot!
  • edited March 2015
    wow that was really nice thread thanks for sharing that with us.
  • edited 11:58PM
    I found this topic while further researching on my own question number 12675.
    I wanted to add a backpicture programmatically.

    Thanks to the answer Saeed has given to his own question I managed to produce the following code:

    FastReport.ReportPage pageRecept = (FastReport.ReportPage)rptRecept.FindObject("Page1");
    FastReport.Watermark watermark = new FastReport.Watermark();
    watermark.Enabled = true;
    watermark.Image = Image.FromFile(@c:\myfiles\diagram.gif);
    pageRecept.Watermark = watermark;

    rptRecept.Show();

    Thanks Saeed for finding the solution to your own question and sharing it with the world!
  • edited 11:58PM
    I have an additional question:

    How can i get/set the color of the Watermark-Text (solid color would be helpful)?
    I can see the Textfill-Property but cannot see how to get/set the specific informations.

    Thank you
  • edited March 2018
    FastReport.ReportPage Page1 = new FastReport.ReportPage();
    Page1.Name = "Page1";
    Page1.Watermark.Enabled = true;
    Page1.Watermark.Text = "CONFIDENTIAL";
    FastReport.SolidFill fill1 = new FastReport.SolidFill();
    Page1.Watermark.TextFill = fill1;
    fill1.Color = Color.FromArgb(71, 128, 128, 128);
    report.Pages.Add(Page1);
    

Leave a Comment