Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing on Terminal Server
Message
From
25/11/2002 08:13:26
 
 
To
25/11/2002 07:00:00
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00726156
Message ID:
00726376
Views:
17
>Hi Bill. Thanks for reply. I checked out with them. Yes It is win2k sp3....But the link you sent refers to the redirected
>printing on remote stations, and we are trying to print to a local
>printer on the terminal server. What also is strange is that MS Office
>(Word, excel) prints with no problems, but FoxPro doesn't. Also it
>didn't matter if I logged in at a console or from a remote workstation. its a vfp 6 exe
>
>One more thing - they created a small program in vfp to open up a
>dataset, and print it. This program seemed to work and printed a page
>as promised. That means the problem is somewhere in my program. They are trying to print reports. and I do that simply by 'report form sample1.frx to print noconsole' . it works fine usual but not on terminal services. In the starting of application I have 'Set printer off' and 'set printer to prn' commands. does that affect?
>

It sounds like either (1) there is embedded printer information in your FRX, which FoxPro uses to redirect the printing away from the local station or (2) there is no default PRN device, so a temporary file is being written rather than output to the local printer.

You need to remove at a minimum the device specification details from the report header so that your report will use the default Windows behavior for the station. Try clearing the EXPR, TAG and TAG2 fields of the FRX's first record ( you could try something like:
USE MyReport.FRX
GO TOP
REPLACE EXPR WITH '', TAG WITH '', TAG2 WITH ''
USE
to remove the printer default detail from the report. It may be preferable to keep certain fields in the EXPR value; at least remove the OUTPUT and DEVICE lines, and if you have a resolution specified that is not supported by some of your printers, either remove the lines related to print quality and Y-resolution, or change them to a least common denominator value.)

Win2K and WinXP by default do not define a PRN device; instead, you want to accept the defaulted device for the station, so issue a SET PRINTER TO rather than SET PRINTER TO PRN within your app. If you need to alter the default printer setting, I'd recommend the use of the WSH Wscript.Network object's SetDefaultPrinter method, as in:
oWSHNet = CREATEOBJ('Wscript.Network')
=oWSHNet.SetDefaultPrinter("MyWindowsPrinterName")
oWSHNet = NULL
SET PRINTER TO at this point would assign the printer named in the SetDefaultPrinter method line.

WSH is present on the Terminal Server, since you are running Win2K TS. You may need to grant users rights to access WSH objects depending on how restrictive your security is configured.

Terminal Server needs to be aware of the proper printer drivers for the workstation; I'd recommend loading the driver into TS via the Printers applet, by running the Server Properties dialog (right click in an empty area of the Printer dialog box and select Server Properties, and select the Device Drivers tag. You may wish to explicitly add the local printer to TS on its assigned port ID - ie TS0001: - to automatically associate the correct driver, and to permit sharing of remote printers.)
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform