Official Content

Defines the header lines to be printed at the top of each page.

Syntax

Header
       code
End

Where:

code
      Sequence of valid language commands.

Scope

Objects: Procedure
Generators: .NET .NET Framework, Java, RPG, Cobol, Ruby (up to GeneXus X Evolution 3), Visual Basic (up to GeneXus X Evolution 3), Visual FoxPro (up to GeneXus X Evolution 3)

Description

The Header command can be included in a Procedure Source. Its use is optional.

The most common use case is to declare it as the first statement (outside of For Each commands) in the Procedure Source. This implies that the data in the Header is printed at the top of each page.

The Header command can also be included inside a For each command defined in the Source. For example, suppose that you have defined a Header command at the top of the Procedure Source (outside any For each) and after that, you define a For each command containing a Header command. In this case, the following will happen every time a page is ejected:

  • What is included inside the main Header command (the one outside the For each command) will be printed.
  • In addition, if the For each command is still being executed, what is included in the Header contained inside it will be printed too.

Samples

Consider the following Transaction object:

Client
{
   ClientId*
   ClientName
}

Suppose you want to define a Procedure to list all your clients. In the Procedure Source, you define a main Header command (it contains the Print command calling the Printblock control called "Header"). After that, you define a For each command that scans over the Client table. The For each command contains a Header command (with a Print command that calls the Printblock control called "TitleClient").

Header
   Print Header
End

For each 
   Header
      Print TitleClient
   End
   Print InfoClient
Endfor

The following image shows the Procedure Layout containing the three Printblock controls invoked with the Print command from the Source (two of them are inside Header commands to be repeated every time a page is ejected):

List of Clients

 

See Also

Footer Command

     

Last update: March 2025 | © GeneXus. All rights reserved. GeneXus Powered by Globant