You can print the results from an Production Reporting program directly from the server. Printing directly from the server avoids the network overhead required to transfer the results back to the client for printing. Using asynchronous mode to run reports also frees up the client application to perform other operations.
To print the results from the server:
Log into the server.
Use a login configured to work with Production Reporting Remote. You should be able to use this login with the RemoteRun method.
Create the script with the filename printsqr.sh and set its execute permission.
The script uses the first parameter as the Production Reporting program filename and the second parameter as the database connectivity. The script also uses the $$ value to generate a unique LIS filename to avoid multi-user conflicts. The script also passes to Production Reporting the -f$LIS_FILE parameter to generate the specified LIS file and the -PRINTER:ps parameter to generate Postscript output. Finally, the script uses the UNIXD command lp to print the results.
This example shows a Bourne shell script. Adjust the script as necessary to fit the needs of your particular server environment.
Start theSQR Production Reporting Activator Visual Basic sample program on the client.
Open a connection to the server using Production Reporting Remote by selecting Remote Connect.
Copy the sample Production Reporting program customer.sqr to the server account by selecting Remote Put under the Production Reporting menu. Then:
Execute the following command asynchronously (with no wait) on the server by selecting Remote Exec No Wait under the Production Reporting menu.
printsqr.sh customer.sqr dblogin/dbpasswd
Following is the Visual Basic code to invokes the printsqr.sh script on the server. Adjust the values of myserver, mylogin, mypasswd, dblogin, and dbpasswd to fit your particular environment. To run an Production Reporting program other than customer.sqr, specify the filename of that Production Reporting program. Note how the following code assumes that the Production Reporting program already exists on the server. This avoids copying the Production Reporting program file to the server upon each run and also avoids multi-user conflicts.