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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change the printer

Status
Not open for further replies.

dkausa4851

Programmer
Mar 3, 2004
10
US
Can fox 9 bring up the Windows Printer selection dialog box? Code from my fox 7 app does not work in fox 9. It will not change the printer but consistantly sends the job to the default printer
 
Boris is correct in that the most likely cause of your problem is a printer setting stored in the report itself.
see faq184-581

But to answer your other question...
GETPRINTER() Will allow the user to select a printer in VFP9.
or
REPORT FORM MyReport PROMPT TO PRINT

Good Luck,
JRB-Bldr
 

Code from my fox 7 app does not work in fox 9.

I don't know of any printer selection functions that worked in 7.0 but no longer do so in 9.0.

It would help if you could show us the code that doesn't work, and it what way it fails.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

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

In VFP 9 that tried and true FRX hack is no longer necessary as there is a checkbox in the Report properties screen now that you can use to specify whether or not to save the printer info in the FRX. That checkbox should be unchecked in order to remove (or never save) the printer details in the FRX.

boyd.gif

SweetPotato Software Website
My Blog
 
Hello to all that answered, thanks.

I am using the REPORT FORM MyReport PROMPT TO PRINT to bring up a Printer Dialog box and it allows me to select a non-default printer but if I print more than one invoice lets say, the dialog box comes up each time and the user has to select the printer again. It did not do this in v7. I was hoping someone had the same issue and had the magic answer as I've tried to capture the selected printer and use it in the Printer Name syntax and all that stuff, but the program keeps going back to the default printer for every invoice. I can have the users change the default printer before doing the print job but that is a total inconvenience and would not be an acceptable solution.
Hope this rings a bell for someone, I'd sure appreciate a tip.

Thanks again.
 
DKA,

I can have the users change the default printer before doing the print job but that is a total inconvenience and would not be an acceptable solution.

Why? The user would not have to be aware that you are doing anything different.

Why not do something like this:

Code:
* Application startup:
gcPrinter = ""

* ...
* ...

* Ready to print the report:
IF NOT EMPTY(gcPrinter)
  gcPrinter = GETPRINTER()
ENDIF
IF NOT EMPTY(gcPrinter)
  SET PRINTER TO NAME (gcPrinter)
  REPORT FORM MyReport TO PRINTER
    && Note: No prompt clause
ENDIF

That way, the user will see exactly the same behaviour as before.

(The two separate tests for EMPTY(gcPrinter) allow for the user cancelling the printer dialogue.)

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