Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cancel printing after Preview
Message
From
16/02/2001 02:29:04
 
 
To
16/02/2001 02:20:00
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00476600
Message ID:
00476601
Views:
23
>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")  && Are we printing this?
RETURN ""            && return an empty string so no output on the report
Now you'd have a call to this repprinted function added as a field in your report.
lPrinted = .f.
REPORT FORM ...
IF lPrinted
  *
  * our output was to the printer not just preview.
  *
ENDIF
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform