>Hello,
>
>Is it possible to detect that the user is exiting of
>"report form (P_Report) to printer preview" without asking to print the report.
>
>In some case the form must be printed in multiple samples except if the user cancel the printing after viewing the first preview display.
>
>*-------------------
>* Sample of code
>Quant=5
>do while Quant>0
> report form (P_Report) next 1 to printer preview
> && If the user cancel the printing
> && exit
> && endif
> Quant=Quant-1
>enddo
>*---------------------
>Thanks
>
>Hubert
You could declare a variable before you do your report, and have the title or the summary band call a udf that changes the variable according to if WEXIST("Printing") was true or not.
FUNCTION repprinted
lPrinted = WEXIST("Printing")
RETURN ""
Now you'd have a call to this repprinted function added as a field in your report.
lPrinted = .f.
REPORT FORM ...
IF lPrinted
ENDIF