Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
W2k printing hassles
Message
From
04/11/2000 22:29:33
 
 
To
25/10/2000 12:14:54
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00434129
Message ID:
00438094
Views:
15
>yes - it's me again - sorry chaps!
>thanx to Ed, George, Fred and the lads, i have CopyFile() working fine getting draft printing to a DM printer, but trying to print .frx reports with W2k is a 'no go'. 'set printer to name &PrtName' gets a 'error accessing printer spooler' and 'report form xyz.frx to printer prompt noconsole' gets 'error loading printer driver' message. i have cleared out the junk in the report memo field etc. printing a windoze test page worx fine, but just nothing from vfp. under 98 and 95 everything worx fine.
>ideas anyone?

First, avoid using macro expansion as much as possible - unless the variable PrtName contains more than just the printer name, you can use name resolution by enclosing the variable in parenthesis, and the end result is not sensitive to delimiter characters in the printer name:

SET PRINTER TO NAME (PrtName)

This assumes that the printer is installed on your system already with a valid driver. Under NT, this can be either a Windows Printer Name as retrieved using GETPRINTER() or a selection from APRINTERS(), or the UNC of a remote printer that (1) has been previously installed on your system and has a driver associated with it already, or (2) the machine sharing the printer makes a set of drivers for Win2K/WinNT available to other Win2K/WinNT systems when they access the printer, so that the drivers self-install. THis behavior is commonly associated with 2K/NT systems that share a printer, where the administrator has taken the time to properly publish both Win9x and WinNT compliant drivers. Most Win9x boxes do not bother to publish NT-compliant drivers through the standard Printer Sharing dialogs, but a well-administered domain often handles this. NetWare shared printers usually do not publish drivers for the queues they manage, nor do most IP-based printing solutions.

I usually install a dummy printer named GTF to the device FILE:, with the Generic/Text Only driver on all my target systems; I can then do:

SET PRINTER TO NAME ("GTF")
SET PRINTER TO MyFileName

and create generic output, even from report forms, or using text merge or ??? to send output to files for use with CopyFile() (with VFP6, I'm able to build strings and user STRTOFILE(), avoiding the issue entirely, using VFP's native string handling and VBScript.RegExp to parse and insert control codes as directed.)
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