Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Crystal's automation server and selecting a printer
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00207527
Message ID:
00207598
Vues:
13
>Has anyone created a user interface for Crystal using Crystal's automation server and created a printer selection dialog using the PrintDlg Win32API call? Crystal needs the DriverName, PrinterName, and PortName passed to its SelectPrinter method to change to a different printer. The information can be obtained thru pointers to either DEVMODE or DEVNAME handles. I understand that VFP does not support pointers. I downloaded the pointers class from the UT written by Paul Vlad Tatavu that will enable the use of pointers in VFP but I need an example of how this would work with what I am trying to accomplish (please excuse my ignorance!).
>
>I guess the bottom line is: Has anyone successfully developed a printer selection screen for the Crystal automation server that they would like to share with the rest of the "class" before I reinvent the wheel? Even if you have used the Windows Printer Dialog and have an example of how I can grab the driver name, printer name, and the port name, I would greatly appreciate it! I know this doesn't come up much in VFP because of the GETPRINTER() function, but Crystal needs more than the printer name to select a new printer.
>
>TIA for any help you can provide!
>
>James

This might help some (using the ActiveX Control):

lcprinter=GETPRINTER()
IF EMPTY(lcprinter)
RETURN
ENDIF
lcPrinterName=lcprinter
lcPrinterDriver=""
lcPrinterPort=""
lcbuffer = SPACE(500)
lnlength = LEN(lcbuffer)
IF x2setlib("FOXTOOLS")
lnlength = GetProStrg('devices',lcPrinterName,"",@lcbuffer,lnlength)
ENDIF
lcbuffer=ALLTRIM(lcbuffer)
lncomma1=AT(",",lcbuffer,1)
IF lncomma1<>0
lcPrinterDriver=LEFT(lcbuffer,lncomma1-1)
lcPrinterPort=RIGHT(lcbuffer,LEN(lcbuffer)-lncomma1)
ENDIF
THISFORM.pgfpagerefresh1.page2.oleCRReport.PrinterDriver=ALLTRIM(lcPrinterDriver)
THISFORM.pgfpagerefresh1.page2.oleCRReport.PrinterName=ALLTRIM(lcPrinterName)
THISFORM.pgfpagerefresh1.page2.oleCRReport.PrinterPort=ALLTRIM(lcPrinterPort)
Richard DeZeeuw
DeZeeuw Software Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform