Create Overlay Band with Code

Hello,

i try to add a Overlay Section with Code.
I found one Artikel from FR2.0 but i can not translate this to the FR.Net C# Version.
What i will do is to put a Background Piture behind each Formular.

Is there some Sample Code, or another way to do that?

Regards, Frank

Comments

  • edited 7:27AM
    Hello,

    You can look at the sample project in the Demos\C#\ReportFromCode folder.
    To create an Overlay band, use the following code:

    page.Overlay = new OverlayBand();
    page.Overlay.Height = ...;
    page.Overlay.CreateUniqueName();
  • edited 7:27AM
    Hi,

    sorry for my Beginners Questions,
    I have look at the samples, but not readable with VS C#Express is this right?

    I can generate a Report with:

    FastReport.Report report = new FastReport.Report();
    FastReport.ReportPage page1 = new FastReport.ReportPage();
    page1.Name = "Page1";
    report.Pages.Add(page1);

    page1.Overlay = new FastReport.OverlayBand();
    page1.Overlay.Name = "Overlay1";
    page1.Overlay.Height = 10 * 1.5f;

    report.Design();

    But how to do this by a existing Report?

    FastReport.Report report = new FastReport.Report();
    report.Load(@E:\fx1.frx);

    report.Pages[0].Overlay= new FastReport.OverlayBand(); ??

    report.Design();

    Regards, Frank



  • edited 7:27AM
    I don't have VS Express. The project was created using VS 2005 Professional.

    To add an overlay band to the existing report:
    FastReport.Report report = new FastReport.Report();
    report.Load(@"E:\fx1.frx");
    
    FastReport.ReportPage page1 = report.Pages[0] as FastReport.ReportPage;
    
    page1.Overlay = new FastReport.OverlayBand();
    page1.Overlay.Name = "Overlay1";
    page1.Overlay.Height = ...;
    
  • edited 7:27AM
    Hello AlexTZ,

    thanks for the very quick Help.

    Regards, Frank

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.