Stores the current page number. It is useful when the Procedure object prints information. The page count starts at 1 and GeneXus automatically manages this variable value by adding 1 to it every time the page advances. If another starting value is required, the value of &Page can be changed.
Data Type:
Numeric (6)
Objects: Procedure
Consider the following Transaction object:
Customer
{
CustomerId*
CustomerName
CustomerDateOfBirth
CustomerEmail
CustomerPhone
}
Suppose you need to implement a PDF report that lists all the customers' names, dates of birth, emails, and phone numbers.
This listing may have several pages. Therefore, each page must show the current page number and the total number of pages, as follows:

To do so, follow these steps:
1. Create a Procedure object.
2. Configure the Procedure properties, as shown below:
3. Go to the Rules tab and write:
Output_File("CustomersPDF","PDF");
4. Go to the Layout tab. You will see one predefined Printblock control (named "printBlock1"). Edit the Printblock's Name property and set it to "CustomerInfo".
5. Insert the Customer attributes you want to list inside that Printblock:

6. Create a new Printblock control. To do so, right-click on the "CustomerInfo" Printblock and select Insert Printblock in the contextual menu.
7. Edit the Name property of the newly inserted Printblock and set it to "CurrentPage".
8. In the "CurrentPage" Printblock, insert the &Page variable. Also, insert a Textblock control and edit its Text property to {{Pages}}:

9. Finally, in the Procedure Source define the following code:
For each Customer
Print CustomerInfo
endfor
Footer
Print CurrentPage
End
That's all! You can now run the listing and view the &Page variable and {{Pages}} template.
Standard Variables List