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

What File In Windows Contains The Printer Names For Set Print To 2

Status
Not open for further replies.

drosenkranz

Programmer
Sep 13, 2000
360
US
Hello,

I have a user's report that must be run on a dot matrix because of carbonless paper rqmts. I've developed it with a Panasonic KXP1180 but I get an error on the user's machine because their dot matrix is different. Do I have to install their printer driver on my machine and save the report using that printer setup or can I just use Set Print To <TheirPrintername> in my program and install it on their machine?

Will Set Print To <TheirPrinterName> solve the problem by itself or do I need to install the user's print driver, specify the printer in my report, and then compile my EXE?

How do I find the &quot;name&quot; of the printer for my Set Print To statement?

Thanks.

The 2nd mouse gets the cheese.
 
You can get a list of the printer names with APRINTERS(). You may find that clearing out the printer specific information in your .FRX fields useful. There is a FAQ on how to do this - faq184-581.

Rick
 
drosenkranz

The following code has been lifted from an applcation so will need modification

CREA TABLE tables\printers (printer C(40),port C(20),expr M)
APRINTERS(laPrinters)
IF VARTYPE(laPrinters) # &quot;U&quot; && If a printer exists
[tab]ASORT(laPrinters)
[tab]APPEND FROM ARRAY laPrinters
[tab]DELETE FOR PRINTERS.port = [FILE:]
[tab]DELETE FOR PRINTERS.port = [Share]

[tab]LOCATE FOR SUBSTR(PRINTERS.port,1,3) = [COM]
[tab]IF FOUND()
[tab][tab]REPLACE USER.fax_name WITH PRINTERS.printer
[tab][tab]DELETE
[tab]ELSE
[tab][tab]REPLACE USER.fax_name WITH []
[tab]ENDIF
[tab]RELEASE laPrinters
ENDIF

If you run this in your main.prg with SET SAFETY OFF, you will keep the individual workstations updated with available printers.

To use a printer, SET PRINTER NAME TO NAME PRINTERS.printer which you can extract from a combobox or similar.

Chris


 
Hi
To solve the printer driver getting stored in the report header, you have to hack the report forms every time you are ready to distribute your application. Assuming, you have all your reports saved in the same directory, you can use my hacking programme, automatically pick up all the report forms and do the printer driver hacking, and then compile the application. This will solve most of the printer related problems. However if you are specifically adding any printer related information in your report, this is not the solution. But such reports almost always causes problem when you switch the printer. The hacking programme can be copied from my FAQ

How to hack FRX file to strip printer driver information
faq184-581


ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top