* Get the total number of pages... PRIVATE pnPages pnPages = 0 * This value will be passed to the report to indicate * the total number of pages.... LOCAL lcFile * Create a temporary file based on the report to be run... lcFile = SYS(3) + ".TMP" REPORT FORM (ThisForm.pReportName) TO FILE (lcFile) NoConsole * Erase the file-it is no longer needed.... Erase(lcFile) * Now we have the total number of pages of the report... pnPages = _PAGENO DO CASE * View report on screen... CASE ThisForm.cntOutput3.opgOutput.Value = 1 REPORT FORM (ThisForm.pReportName) PREVIEW * Print the report... CASE ThisForm.cntOutput3.opgOutput.Value = 2 REPORT FORM (ThisForm.pReportName) TO PRINTER PROMPT NOCONSOLE ENDCASENow on the Report Footer place a label with some text – Page Number – then drop on a field from the Report Controls Toolbar next to your label (Page Number). Give it a value of _PAGENO. Repeat this process with a second field object and give it a value of pnPages.