Craig,
There's one more flaw to consider if you are printing the report. If you need to print to a printer, you must prompt the user for the printer first with SYS(1037). Otherwise, the report could get printed using driver A in the dummy print, then the user could pick Printer B for the real printing. The problem is that Printer A and Printer B might have different non-printable margins .. which means they could break at different points causing a different page count!!
Cathy
>There is one flaw in this method. Under certain conditions, which are somewhat obscure, the final page count will be off by one. The fix is to run the report to file the first time.
>
>REPORT FORM MyRep NOCONSOLE TO FILE MyFile.txt
>lnPages = _PAGENO
>ERASE MyFile.txt
>REPORT FORM myRep Preview
>
>
>>Hi Robert
>>
>>You have to print the report with NOCONSOLE
>>store the number of pages which will be held in _PAGENO
>>then print the report again.
>>
>>lnPages=0 && Must init before rep
>>REPORT FORM myRep NOCONSOLE
>>lnPages=_Pageno && last Page of Rep
>>REPORT FORM myRep Preview
>>
>>Like so.
>>
>>Nick
>>
>>>How can i know the number of page of a report ?