Page 1 of 1

Option NAME does not work for me on printers connected to non-local computers.

Posted: Tue Dec 07, 2021 10:52 pm
by Diego Euri Almanzar
When I use the NAME option, it works correctly if the invoked printer is connected to the computer. But, it does not work for me, when the printer is on another computer, even though it is shared on the network. That is, it works for me on a local printer. It doesn't work for me on a shared printer.

I need help please.

DCPRINT OPTIONS [NAME <cPrinterName>]

Best regards.

Re: Option NAME does not work for me on printers connected to non-local computers.

Posted: Wed Dec 08, 2021 1:10 am
by skiman
Hi,

This is because the name of the printer is different in that case. Just get a list of the printers, search for the printer you need, and use the complete name.

Code: Select all

cPrinterName := "xxx"   -> name of the printer you want to print on.
o := xbpprinter():new()
aPrinters := o:list()
for x = 1 to len(aPrinters)
	if cPrinterName $ upper(aPrinters[x])
		cPrinterName := aPrinters[x]
	endif
next
As result you will have the complete printer name as it is seen in Windows. Now you can use it.

Re: Option NAME does not work for me on printers connected to non-local computers.

Posted: Wed Dec 08, 2021 5:23 am
by Tom

Code: Select all

if Upper(Trim(cPrinterName)) $ upper(aPrinters[x])

Re: Option NAME does not work for me on printers connected to non-local computers.

Posted: Wed Dec 22, 2021 9:40 pm
by Diego Euri Almanzar
Excellent, wonderful. Thanks a lot, Skiman and Tom.