The Windows Printing Printer Name specifies the full name of the printer. If specifying a network printer, the domain name must also be included. That is, WPPN=\\domain\printer name. For example, WPPN=\\ourdomain\Epson Stylus COLOR 900.
The LIST_PRINTERS BIF returns the full printer name as required by this parameter.
This parameter is not passed to (inherited by) a server system. To print from a server in a client/server environment, retrieve the list of printers defined on the server by calling a function on the server that uses the LIST_PRINTERS BIF. The selected printer's name can then be exchanged back to the server when the print function is called. For example:
***************************************************
** CLIENT SIDE FORM
***************************************************
FUNCTION OPTIONS(*DIRECT)
BEGIN_COM ROLE(*EXTENDS #PRIM_FORM) CLIENTHEIGHT(240) CLIENTWIDTH(492) HEIGHT(267) LEFT(378) TOP(238)
* DEFINE_COM commands appear here to define controls on dialog.
DEF_LIST NAME(#PRNLIST) FIELDS(#PRN_NAME #PRN_LOC) TYPE(*WORKING)
EVTROUTINE handling(#com_owner.Initialize)
SET #com_owner caption(*component_desc)
USE BUILTIN(SET_SESSION_VALUE) WITH_ARGS(USER MyUserid)
USE BUILTIN(DEFINE_ANY_SERVER) WITH_ARGS(MYSERVER Server1 Y) TO_GET(#STD_CMPAR)
USE BUILTIN(CONNECT_SERVER) WITH_ARGS(MYSERVER 'MyPassword') TO_GET(#STD_CMPAR)
USE BUILTIN(CALL_SERVER_FUNCTION) WITH_ARGS(MYSERVER GETPRNS Y Y #PRNLIST) TO_GET(#STD_CMPAR)
SELECTLIST NAMED(#PRNLIST)
ADD_ENTRY #LTVW_1
ENDSELECT
CHANGE FIELD(#DEPTMENT) TO(FLT)
ENDROUTINE
EVTROUTINE HANDLING(#PHBN_PrintEmplistD.Click)
EXCHANGE FIELDS(#DEPTMENT #PRN_NAME) OPTION(*ALWAYS)
USE BUILTIN(CALL_SERVER_FUNCTION) WITH_ARGS(MYSERVER SRVEMPL Y Y) TO_GET(#STD_CMPAR)
ENDROUTINE
END_COM
***************************************************
** SERVER SIDE FUNCTION
***************************************************
FUNCTION OPTIONS(*DIRECT) RCV_LIST(#PRNLIST)
DEF_LIST NAME(#PRNLIST) FIELDS(#PRN_NAME #PRN_LOC) TYPE(*WORKING)
USE BUILTIN(LIST_PRINTERS) WITH_ARGS(A) TO_GET(#PRNLIST #STD_CMPAR)