I have now tried without "rest page number", but this gives also problems:

I have an Invoice report with page header 1. This is called up on every back page. Page Header 2 is the first page of the bill. Further front pages are defined as group footer.

When creating the necessary functions, the following results:
If I have the function (page = page + 1) on page header 1 (ie 2) this only fits on the first back. on the second back it shows instead of 4 only 2, although in the group footer with another function (Page = 3) is identified. That is, the output pages are not taken from the page value of the previous page.
How is this regulated in the reportwriter?