Page Numbers and Page Counts can be inserted into the report output using the special variable substitutions ${#} (current page number) and ${##} (total page count) respectively.
Note that you can't use these substitutions in scripts because the values are only substituted at the end of rendering. It is not possible to determine these values during rendering because a) the report might be embedded as a subreport, b) there may be multiple sections c) the total page count can't be known until all pages have been rendered. To perform operations based on the current page, consider using OnLayout instead.
-- JonPriddey - 04 Aug 2005