Backpicture

I want to insert a backpicture on my report. I can't find a topic in the user's manual or the programmers manual.

I would like instructions both for the designer and for manipulating a backpicture in code (I use C#, but any .Net language is fine).

Thanks in advance,

Comments

  • edited 12:56PM
    I've found how to do it in the designer:

    Select the page object
    Find the Watermark property (at the bottom)
    Click it once to show a button with three dots
    Press the button
    Select the second tabpage
    Load an image


    So I have to look for the watermark property in code, but no luck in that:

    This works:
    FastReport.PageBase pageRecept = (FastReport.PageBase)rptRecept.FindObject("Page1");

    the pageRecept object (a PageBase object), doesn't have a property watermark, so I have to search further, but all these options don't work:
    FastReport.Watermark pageWatermark = (FastReport.Watermark)pageRecept.Page.FindObject("Watermark");


  • edited 12:56PM
    Thanks to Saeed Moradi I found how to do it in code.
    The topic of his question is 8661 and he found:

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

    I had to adjust a little:

    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;

    Thanks Saeed for finding the solution to your own question and sharing it with the world!

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.