Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Selecting a Printer programatically
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01202530
Message ID:
01202534
Vues:
13
DEFINE POPUP SetReport SHORTCUT RELATIVE ;
    FROM MROW(),MCOL() ;
    TITLE "Report Options" MARGIN

DEFINE BAR 1 OF SetReport PROMPT "Set Printer \<Options"
DEFINE BAR 2 OF SetReport PROMPT "How \<Many Copies?"
DEFINE BAR 3 OF SetReport PROMPT "\<Cancel Printing"
DEFINE BAR 4 OF SetReport PROMPT "Send Report to \<Printer"
ON SELECTION POPUP SetReport DEACTIVATE POPUP
*****************************************************
DO WHILE .T.
   ACTIVATE POPUP SetReport
   IF BAR() = 1
      SYS(1037)
   ENDIF
   IF BAR() = 2
      LOCAL nCopies
      nCopies = ''
      nCopies = VAL(INPUTBOX("Specify Number of Copies ?","","1"))
      IF ! nCopies => 1
         =MESSAGEBOX("Specify Number of Copies as number",0+16,"Error")
         KEYBOARD '{M}'
         nCopies = 1
      ELSE
         nCopies = 1
      ENDIF
      _pCopies = nCopies
   ENDIF
   IF BAR() = 3
      SET DEVICE TO SCREEN
      EXIT
   ENDIF
   IF BAR() = 4
      ** DO PRINTING JOB
      EXIT
   ENDIF
ENDDO
>Hi.
>I have a report where a different form layout is printed , depneding on who the customer is.
>Si I have a loop like:
>Sele MyAlias
>Do while not eof()
> Copy 1 record to ReportFile
> Use reportFile
> Do case
> Case 1-- Print FormA
> Case 2-- print FormB
> Case 3-- Prnt FormC etc
> Sele MyAlias
> Skip
>Enddo
>
>So I want to be able to select the printer, and its settings at the start of the loop
>Options i've loked at
>Sys(1037) Lets me select printer but does not return a printer name so I can set printer to
>Getprinter.. lets me select a printer name that I can set but does not allow me to change other properties e.g. the number of copies.
>
>Is there any printer dialogue that can be accessed from within VFP that mimics exactly the Windows Printer dialogue ?
>Regards,
>Gerard
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform