Overview
Page reports display the number of records on each page dynamically by default. The number of records is determined by the page size and content. To override this functionality, you can write a formula to control the number of records displayed on each page.
Solution
Follow these steps to create a formula to control the number of records on each page of the report:
- Define and initialize the global record number. Use the following code and insert it into the report header section:
global integer num;
num=0; - Calculate the record number by incrementing the global record variable initialized in the previous step. Use the following code and insert it into the detail section:
num=num+1;
You can set the property "invisible" to true in the report template so the value is not displayed. - Determine how many records to show on each page by controlling the behavior when the global record variable reaches a specific count. For example, use the following code to control the On New Page detail section property to show 10 records per page:
if (remainder(num,10)==0 && num!=0) return true
else return false