PageHeader2

Hi is it possible to print only one time PageHeader2 Child1?

i try avery way but only work if i select Child1 OddPages, or EvenPages

I only need to print one time and then hide.

Thank´s

Comments

  • You can use AfterData event for your band to it. Code for example:

    namespace FastReport
    {
     public class ReportScript
     {     
      bool firstTime = true;
       
      private void Child1_AfterData(object sender, EventArgs e)
      {
       if (firstTime)
        firstTime = false;
       else
        Child1.Visible = false;
      }
     }
    }
    
  • Hello!

    To ensure that the Child1 child band under PageHeader2 prints only on the first page, you can do this even more easily without a script by using the PrintOn property:

    Select Child1 in the designer and open the PrintOn property in the inspector.

    Leave only FirstPage and SinglePage checked (uncheck OddPages, EvenPages, LastPage, and RepeatedBand): PrintOn.FirstPage | PrintOn.SinglePage.

    Alternatively, as Anatoly showed in the thread, use the flag `bool firstTime = true;` in `Child1_AfterData` (or check for `[Page#] == 1` in `Child1_BeforePrint`)

This discussion has been closed.