SET PRINTER TO NAME... doesn't, sometimes?

Author: Ted Roche

Posted: 2005-04-11 at 17:20:29

We've got a vertical niche app running in VFP 7, and have coached the

clients through installing PDF995 as a printer driver and it is working

very well for them to pick manually from a REPORT FORM TO PRINT PROMPT

situation. Now, we'd like to be able to offer them the ability to print

to a PDF as part of a pre-report dialog.

Basically, the code is picking the PDF995 printer from the list in

APRINTERS() ('cause some workstations have 'PDF995' installed and some

'PDF995Share') and issuing a:

SET PRINTER TO NAME lcPrinter

In the Debug window we are seeing SET("PRINT",2), the windows default,

stay the same, and SET("PRINT",3), the VFP currently selected printer,

switch to the PDF995 printer. That command is followed by a REPORT FORM

TO PRINTER.

Sometimes, it generates the PDF. Sometimes it comes out the Windows

default printer.

We've tried throwing in various time delays (WAIT NOWINDOW TIMEOUT and

DOEVENTS()) with no change.

Reports are all stripped of printer information.

Ideas?

Ted Roche

Ted Roche & Associates, LLC

http://www.tedroche.com

©2005 Ted Roche