The textReport.getPageNumber() function returns the current report page number. The text report engine numbers all pages consecutively beginning with 1.
textReport.getPageNumber()
returns (result INT)
In the following example, currentPage contains the number of the report page that is being printed:
myReport TextReport = new TextReport();
currentPage INT;
...
currentPage = myReport.getPageNumber();