REPORT FORM MyReport to FILE TempRept.prn NOCONSOLE >TotalPages = _PageNo >DELETE FILE TempRept.prn >REPORT FORM MyReport TO PRINT NOCONSOLE >>It doesn't take long to print to the file and it gets you the right number of pages.
=SYS(1037) REPORT FORM MyReport to FILE TempRept.prn NOCONSOLE TotalPages = _PageNo DELETE FILE TempRept.prn REPORT FORM MyReport TO PRINT NOCONSOLEOtherwise, you may have an issue with the printable area being different between the default printer and the one chosen by the user. That could potentially mean that the "TO FILE" report would have a slightly different page count than the "TO PRINT" report because the number of lines that can fit on the page may be slightly different.