watermark

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

thanks

Comments

  • edited 12:03AM
    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 12:03AM
    Thanks! This really helped me a lot!
  • edited March 2015
    wow that was really nice thread thanks for sharing that with us.
  • edited 12:03AM
    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 12:03AM
    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.