What I did back in FPW26 is change the default Wiindows printer, execute the report and then switch back to the printer before setting.
Main Topics
Browse All TopicsI have a application that has to print to multiple printers, I have a table containing the printer names and the associated items that have to print towards the printers.
The app was initially in VFP 6 and all work 100% now i picked up that the printer does not change with a simple set printer to prtname?
I do however run thorugh the printer table with a scan/endscan and compare the table back so the code currently looks a bit like this
Please any help would be apreciated.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Does your answer mean that after the Default Windows printer change in VFP application it still prints to the original printer? Or does it mean the Default printer is not possible to change?
Did you change just VFP version or also the operating system?
This will need some more complex testing and to help remotely is almost impossible...
The last question: Did you store printer environment in your report definition?
Here is one approach that we use successfully
* --- Determine Existing Default Windows Printer For THIS Workstation ---
lcDefaultPrinter = SET("PRINTER",2)
* --- Use APRINTERS() To Determine What Printers Available In THIS Workstation ---
=APRINTERS(gaPrinters)
*
lcNewPrinter = "DesiredPrinter"
IF ASCAN(gaPrinters,UPPER(lcN
* --- Use Windows Scripting To Set Windows Default Printer To New Printer ---
ONET = CREATEOBJECT("WScript.Netw
ONET.SetDefaultPrinter(lcN
* --- Change VFP Printer ---
SET PRINTER TO NAME (lcNewPrinter)
<Do whatever with this 'new' printer>
* --- Return Things To Original Settings ---
* --- When Done Printing - Use Windows Scripting To Restore Original Default Printer ---
ONET.SetDefaultPrinter(lcD
RELEASE ONET
* --- Return VFP Printer To Original ---
SET PRINTER TO NAME (lcDefaultPrinter)
ENDIF
NOT
Good Luck
Business Accounts
Answer for Membership
by: pcelbaPosted on 2009-11-02 at 06:37:17ID: 25719658
Maybe your printer names stored in a table are slightly different from the reality. You could look at this solution: http://www.experts-exchang e.com/Micr osoft/Appl ications/ F oxPro/Q_24 709284.htm l
Another solution is to set default Windows printer before each printing.