Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cancel printing after Preview
Message
De
16/02/2001 02:29:04
 
 
À
16/02/2001 02:20:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00476600
Message ID:
00476601
Vues:
22
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform