Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Crystal's automation server and selecting a printer
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00207527
Message ID:
00207614
Views:
11
>>>>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)
>>
>>
>>Thanks for the code example for getting the printer info from the Windows INI file. This will allow me to initially setup the printer information. However, do you know of a way to allow the user to select a different printer from the Windows API printer selection dialog so I can grab the printer driver, name, & port info? Too bad VFP doesn't return an array with this info from the GETPRINTER() function.
>>
>>Thanks,
>>
>>James
>
>
>See the help for APRINTERS(). This returns an array with the names & ports.


Well, we are two-thirds of the way there. The APRINTERS() function returns an array with names & ports, but I need the printer driver as well for Crystal's SelectPrinter method. Any other suggestions?
James Moore
Owner/Developer
Ministry Tracking Software, Inc.
www.youthtrack.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform