Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set Printer To - is not working

Status
Not open for further replies.

1421

Technical User
Feb 24, 2004
69
Hi,

I did a 'set printer to\\server\printer name' command and then 'repo form abc to print' and it's not going to the 'set printer to' printer. I never tried this before. What am I doing wrong?

Thank You
 
Before getting into any possible SET PRINTER TO problem, have you ensured that your Report Form does not have a printer defined within it?

As long as your report is not in Landscape mode, the following will code work to remove any "inherited" Report Form printer.
Code:
USE "MyReportForm.frx"
SELECT MyReportForm
REPLACE expr WITH "", tag WITH "", tag2 WITH "" FOR RECNO() = 1
USE

Good Luck,
JRB-Bldr
 
This did not work. I checked all the memo fields of the first 2 FRX records & there was no mention of any printer (your 'cleanup' code worked), but the 'set printer' did not change my default (i tried with quotes and without quotes). I did go to File-->PageSetup-->Page Layout-->Page Setup and i saw the default printer in the 'name' box (not the one i 'set printer to') I changed the printer there and that worked. My question is how this can be done progromaticly & i persume 'set printer' should do it.
 
NAME i persume being the printer name. I tried it and it still did not work
 
No:

If you are using windows 2000 and later; and printing to a network printer you should add the keyword "Name". This lets you send to the printer specified by "printer name", and not the default printer i.e

Set printer to Name \\myserver\lan printer name

lan printer name = assigned printer name on the network
 
Thanx a ton!, this worked. When done I had to do 'set printer to default' to return to the default printer, 'set printer to' was not good enough.

Thanx all
 
Hi again,

The purpose of doing this 'set printer' was to send it to a printer which converts the VFP report to a PDF & then gives the user an opportunity to email the report. I used a software package called Win2PDF, it installs as a printer and then you just select this printer.

I am wondering if anyone is familiar with this package in relation to Foxpro, to be able to feed it parameters progromaticly. (FYI: the software publishers website is
Thank You
 
Hi 1421,

Win2PDF comes with a manual which includes information about how to set print parameters programmatically -- see the "Developer Information" section.

You can it either do it by making an API call, or by storing information in the registry. The manual has the details.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Thanx Mike,

I have never done this type of stuff before (registry updates or API call), but I will try to figure something out from the Foxpro help & will let you know if i still need help.

Thank You
 
1421,

I have never done this type of stuff before (registry updates or API call)

In that case, I suggest you've chosen the wrong PDF driver. The code is quite difficult in VFP, and it doesn't help that the examples are in C.

Other PDF drivers are easier to program. For example, I use the Docucom driver, which gets its settings from an INI file.

You might want to look around for an alternative to Win2PDF before you go any further.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top