Daniel:
Way to go. This should do the trick nicely <s>. Thanks for sharing this with me.
>Gary,
>
>The following is a bit of a hack but it should work. The idea is to add a variable to the report which calls a function. The function checks for EOF() and for the presence of the "Printing..." window to determine whether the report was completely run and whether the output was sent to the printer or not. The method stores the result into memvars that must be in scope.
>Something like this:
>
>PROCEDURE WasPrinted
>*-- determines whether a report was run and whether the report
>*-- was sent to the printer or not.
>
>*-- The following memvars must be in scope:
>*-- glReportWasRun: .T. if report was printed/previewed until last page
>*-- glToPrinter: .T. if sent to printer
>
>*-- add a variable to report which calls this procedure
>*-- Value to store: WasPrinted()
>*-- Initial value: WasPrinted()
>*-- Release after report: No
>
>IF VARTYPE(glReportWasRun) = "L"
> IF EMPTY(TAG())
> *-- there's a tag so we cannot use EOF()
> SKIP
> IF EOF()
> glReportWasRun = .t.
> ENDIF
> SKIP -1
> ELSE
> glReportWasRun = EOF()
> ENDIF
>
> IF VARTYPE(glToPrinter) = "L"
>
> glToPrinter = WVISIBLE("Printing...")
>
> ENDIF
>ENDIF
>
>>Friends:
>>
>>If I process a REPORT FORM TO PRINTER PROMPT, is there any way I can tell whether the user abandoned the print job? I tried to set _PAGENO to 0 (Zero) with the thought of testing for the number of pages after the REPORT FROM statement but, VFP complained in the program that this was an illegal value.
>>
>>The same question holds true of PREVIEWing a report. Is there any way to tell whether the user just shut down the preview without printing the report?
>>
>>Any help would be appreciated.
-=Gary