Progress
Client Deployment
Guide
Using an Output-routing Table
More complex output-routing schemes, such as routing output based on the user ID, require the creation of several related Progress tables and an include file that can access these tables and select the proper output command for the particular user.
Just as you can use Progress database tables (_User) to set up security for Progress applications, you can also use Progress tables for output routing. If you want to route application output to different printers based on user ID, set up a Progress table in the application database containing each of the valid user IDs and the corresponding print commands.
Figure 7–3 shows a sample output-routing table.
Figure 7–3: Sample Output-routing Table
![]()
The database table shown in the figure contains records that have a userid field and an outdev field containing an operating system output device. The userid field is a unique primary index for the table. You have to keep the Usrprnt table up to date with a record for each new user on your system.
After setting up the database table, create a Progress include file that determines the current user ID and then searches the Usrprnt table for a matching user ID and corresponding output device. For example:
The include file searches the Usrprnt table for a record that has a user ID that matches the user ID established for the current application session. If there is no user ID match or established user ID for the application session, Progress uses the default system printer. If there is a match, Progress sends the application output to the output device contained in the corresponding outdev field.
The VALUE option of the OUTPUT THROUGH statement allows you to designate a substitutable output device. The USERID function allows you to capture system user IDs on UNIX. For more information about the _User table, see Progress Database Administration Guide and Reference.
After creating an include file to route application output, replace all OUTPUT statements in your application with the include file. For example:
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |