Net Print/400 - Printing a spooled file
The program NETPRTIB processes an AS/400 spooled file, retrieving a copy of the spooled file based on the input parameters. Then the program transforms the spooled file into a printable or displayable format, and sends the transformed data to the client (browser). The program works in conjunction with the SNDSPLFNP command (Webulator/400 session), or the link results of the Netprtsp.d2w Net.Data macro (CGI session) to receive the input parameters. The parameters listed for the CGI session are necessary information if you wish to create your own interface to call this program, or modify the Net.Data Macro provided. In a CGI session, NETPRTIB receives the parameters from a query string environment variable.
The NETPRTIB program was created with the user profile (USRPRF) parameter of the program set to *USER. As a result, owner authority adoption will not take place based upon execution of the NETPRTIB program. If adoption is desired, the program must be changed or called from within another that does adopt the owner's authority.
NETPRTIB program directly from the browser location if you know the details for a given spooled file on your system, and the server user profile has spooled file authorities for that spooled file.http://server:port/URL-path?Query string
http://
server
port
URL-path
Query String
NETPRTIB program accepts parameters via named query string value. See section Parameters: (CGI Session) for more information on the order and meaning of each parameter. In addition, a parameter is added at the end of the query string (.np or .htm). This is needed by Microsoft IE browsers to ensure that the Net Print/400 plug-in is properly loaded to print the report. An example URL follows:http://your.host.com:/cgi-bin/netprint/netprtib.pgm?FILE=spooled file&JOBNAME=job name&USERNAME=user name&JOBNUMBER=number&SPLNBR=spooled file number&MFRTYPMDL=Manufacturer type and Model&WSCSTOBJ=Workstation customizing object&WSCSTLIB=Workstation customizing object library&DEVD=Printer device name&EXT=.np
Using Manufacturer Type and Model:
http://your.host.com:/cgi-bin/netprint/netprtib.pgm?FILE=CUSTMNT&JOBNAME=CUSTMNT&USERNAME=JOHNDOE&JOBNUMBER=012345&SPLNBR=1&MFRTYPMDL=*HP4&EXT=.np
In this example the, Manufacturer type and model parameter is "*HP4" which corresponds to a Hewlett Packard LaserJet 4 series printer.
Using Printer Device Name:
http//:your.host.com:/cgi-bin/netprint/netprtib.pgm?FILE=CUSTMNT&JOBNAME=CUSTMNT&USERNAME=JOHNDOE&JOBNUMBER=012345&SPLNBR=1&MFRTYPMDL=*DEVD&DEVD=mydevice&EXT=.np
In this example the Manufacturer type and Model parameter is "*DEVD", and the Printer device name is "mydevice", where "mydevice" is an AS/400 printer device description that must correspond to the attributes of the actual printer where the report will be printed.
Using Workstation Customizing Object:
http://your.host.com:/cgi-bin/netprint/netprtib.pgm?FILE=CUSTMNT&JOBNAME=CUSTMNT&USERNAME=JOHNDOE&JOBNUMBER=12345&SPLNBR=1&MFRTYPMDL=*WSCST&WSCSTOBJ=myobject&WSCSTLIB=myobjectlib&EXT=.np
In this example the Manufacturer type and Model parameter is *WSCST, and the Workstation customizing object is "myobject" in "myobjectlib". The "myobject" WSCST must define the attributes of the printer where the report will be printed.
For more general information about URL locations, visit this link.
Spooled File Name: (FILE)
char(10) Must be the name of the existing spooled file that is to be printed or displayed.
Job Name: (JOBNAME)
char(10) The specific job name that contains the spooled file to be printed, or *
meaning only the job that this program is running. The rest of the job name field must be blank.User Name: (USERNAME)
char(10) A specific user profile name associated with the job, or blanks when the job name is *
Job Number: (JOBNUMBER)
char(6) A specific job number, or blanks when the job name is *
Spooled File Number: (SPLNBR)
char(4) This parameter specifies the spooled file number to be printed. The value maybe 1-9999 Two special values are also accepted.
Manufacturer Type and Model: (MFRTYPMDL)
char(15). This parameter contains the manufacturer type and model for a printer being used. The following special values can be used.
*WSCST
A workstation customizing object is used to obtain the printer attributes.*DEVD
An AS/400 device description is used to obtain the printer attributes. *HTML
The spooled file is displayed as an HTML document at the browserWorkstation Customizing Object: (WSCSTOBJ)
char(10) The value of this parameter is based upon 1 of 2 conditions.
*DEVD, then this parameter is all blanks, or may be omitted.
*WSCST, then the first ten characters must contain the name of a Workstation customizing object. The next ten characters must contain the library name that contains that object must also be specified.
Workstation Customizing Object Library: (WSCSTLIB)
Printer Device Description: (DEVD)
char(10) The value of this parameter is based upon 1 of 2 conditions.
*DEVD, then this parameter must contain a valid AS/400 printer device name.
*WSCST,. then this parameter is all blanks.
*WSCST and *DEVD, see "Manufacturer Type and Model" in Chapter 3.
NETPRTIB program must be called to send the spooled file data to the browser to be printed or displayed.
Note:Basic Information about CGI, and CGI Scripts can be found at
this link.
/QDLS/NPW directory. If you use the sample macro, you must ensure that Net.Data is installed and configured correctly for your server. You should also copy the macro to a location where other macros on your system are located.
Netprtsp.d2w.
The Net.Data macro as provided, displays a list of spooled files available based on the parameters entered in at the Net.Data form. To do this, the Net.Data interface calls the program NETPRTSP which sends the spooled file list back to the macro, which then displays the list to the browser. Each spooled file name displayed at the browser has a link. When the link is selected by the user, the NETPRTIB program is called to send the spooled file to the browser.
Using the Net.Data macro as provided, a typical session would be:
Figure 5.1 Net.Data Interface- Basic Form
Figure 5.2 Net.Data Interface -Advanced Form
Figure 5.3 A displayed list of spooled files.
These are the screens you would see from the Net.Data macro provided.
Basic Form:
*CURRENT
The user profile under which the current server job is running is used. (Default)*ALL
Files created by all users are selected.USER-NAME
Specify the name of the user whose user print information is to be displayed.Advanced Form:
*CURRENT
The user profile under which the current server job is running is used. (Default)*ALL
Files created by all users are selected.USER-NAME
Specify the name of the user whose user print information is to be displayed.*ALL
Files on all output queues. (Default)Output queue name
The name of the output queue.*CURLIB
The job's current library (keep in mind that this can change during the execution of some servers).*LIBL
The library list*ALL
Files for all form types. (Default)*STD
Only files that specify the standard form type.DEFAULT: Display as an HTML documentDEFAULT: BLANKDEFAULT: BLANKCustomizing the Net.Data Macro
The code for the Net.Data macro provided can be customized to suit individual needs. You might want to change the appearance to conform with other applications you have, or make it look unique.The final objective must be to send a request to the server to execute the main processing program NETPRTIB, sending in the appropriate parameters. See "Parameters: (CGI Session)" for information on parameters.
Note: For more information on Net.Data, Please refer to the IBM Net.Data information and documentation. Additional information can be found at:
http://www.AS400.ibm.com/netdata
Customizing the error messages delivered to the browser in a CGI environment
All CGI messages can be found in the message file NPWMSGF. Each of these messages, associated with CGI errors, are in the area NPW07XX. The content of these messages can be edited to suit the users needs. Care should be taken to retain the general format and meaning of the various messages to insure proper operation and user understanding.
NETPRTIB program with a query string filled with specific parameters for the report to be printed or displayed.
Copyright © I/NET All rights reserved.