Remote Printing

From BR Wiki
Jump to: navigation, search

Remote Printing is used in the Client Server model of Business Rules!

Valid Business Rules printer names are:

  • LPT1: ( port name )
  • PRN://10 original BR printer designation - denoting LPT1:
  • PRN:/ printer number or name

Normally legacy programs redirect PRN:/ printer names to one of the following (via SUBSTITUTE configuration statements):

  • WIN:/ case sensitive printer name substring (partial name)
  • PREVIEW:/ name substring
  • DIRECT:/ name substring

In Client Server mode printing normally occurs on the CLIENT.

SPOOLCMD governs PRN:/ output, and if @ is not indicated SPOOLCMD runs and prints on the server. There is nothing, however, that prevents SPOOLCMD from forwarding spooled output to clients.

With OPTION 30- (suppress remote printing)

PRN:/ and WIN:/     print on the server
PRN:@/ and WIN:@/   print on the client

Option 31 - suppresses native windows formatting but doesn't suppress printing via Windows. OPTION 31 has been deprecated in favor of DIRECT:/

==========================================================================

 Printer                        Output Method
 Name	------------------------------------------------------------------
 PRN:/	Server:	Linux 	Linux 	   Linux	Windows		Linux
		Opt 30	Spoolcmd   both		Spoolcmd	Spoolcmd @
	------------------------------------------------------------------

 PRN:/	client	server	server	   server	client		client
	direct	lp	spoolcmd   spoolcmd	spoolcmd	spoolcmd


                    PRN:@/, WIN:/, WIN:@/ or PREVIEW:/ 

 Opt 31	client	client	client	   client	client		client
        direct mode ---------------------------------------------------->

 WIN:/	client	server	client	   server	client		client
        native windows printing ----------------------------------------->

 PREVIEW:/
  -or-
 WIN:@/	client	client	client	   client	client		client
        native windows printing ----------------------------------------->

==========================================================================


Notes

OPTION 30 is not allowed on Windows servers.

SPOOLCMD always runs on the server unless it specifies a leading @.
e.g. SPOOLCMD @ print.bat [SPOOLFILE] runs print.bat on the client.

Ctrl-P only works at a LINPUT statement or at a command prompt.

Client side reports are always created in a spool file on the client. This includes both WIN:/ and 'SPOOLCMD @' reports.

Two SPOOLPATH statements are allowed, one for the server and one for the client. The client SPOOLPATH should have '@' right after the SPOOLPATH keyword (e.g. SPOOLPATH @ ...) to designate where on the client spool files should be placed.

The config statement
SPOOLCMD  @  print.bat [SPOOLFILE]

Causes print.bat to be issued ON THE CLIENT in the client current directory.


Direct Printing

DIRECT:/ can be used in lieu of PRN:/ to ignore SPOOLCMD. DIRECT:/ is synonymous with PRN:/ except that SPOOLCMD doesn't apply to DIRECT. ( DIRECT:/ is equivalent to specifying WIN:/ with OPTION 31 on. )

Now Parametrized Printer Substitution statements are now supported along with several other NWP enhancements, including shading, boxing and pictures.

Printer_List()

Printer_List() is a system function that loads an array with local printer definitions.

An example of its use:

10 DIM A$(1)*1000
20 Printer_List(A$)
30 PRINT MAT A$

This will print a list of printer names with each followed by their respective @port-name.

The array A$ will be redimensioned by the system to the correct number of elements, but you must first dimension the length of the elements as shown in the example. Microsoft OneNote tends to include a very lengthy printer definition.