You have to preprocess the report yourself and use your own variable .. not the system variable. Use this code to run the report and in the report use lnPages instead of _PAGETOTAL.
LOCAL lnPages, lcTemp
lnPages = 0
lcTemp = FORCEEXT(SYS(2015), '.txt')
WAIT WINDOW 'Preprocessing report...' nowait
REPORT FORM Report1 NOCONSOLE TO FILE &lcTemp NOPAGEEJECT
REPORT FORM Report2 NOCONSOLE TO FILE &lcTemp NORESET
lnPages = _PAGETOTAL
ERASE (lcTemp)
WAIT CLEAR
REPORT FORM Report1 TO PRINTER PROMPT PREVIEW NOPAGEEJECT
REPORT FORM Report2 TO PRINTER PROMPT PREVIEW NORESET
>I'm chaining two reports, using the report listener.
>Let's say:
>ReportA, which produces 20 pages
>ReportB, which produces 5 pages.
>I've the need to print all pages with page numbering x/y i.e.
>page 1 of 25, 2 of 25 ...
>I can't use _pagetotal, which always return 20 after ReportA is processed
>so I would get
>Page 20 of 20 and then page 21 of 25 (when ReportB is processed).
>How can I get _pagetotal keep the whole page count?
>
>TIA
>Bruno