Sybase Business Intelligence Solutions - Database Management, Data Warehousing Software, Mobile Enterprise Applications and Messaging
Sybase Brand Color Bar
delete

Search for    in all of Sybase.com
view all search results right arrow
  blank
 
 
 
 
 
 
 
 
 
 
Support > Technical Documents > Document Types > Technote > Redirecting Reports To Different Printers In EASer...

Redirecting Reports To Different Printers In EAServer On Solaris
 
RSS Feed
 
 
 

Introduction
PowerBuilder 8.0.2 PBVM supports printing DataWindow/Datastore objects produced
by PowerBuilder components running on EAServer on the Solaris platform.

The dwprint.ini located in the $JAGUAR/bin contains current printer setup information. The format
of this file allows you to define more than one printer but only one printer can be define as the default.
What this means is if you have several reports that you want printed on different printers, the
default printer value needs to be updated in the dwprint.ini.  For details on how to set up the
dwprint.ini, see the readme.txt in the PBVM 8.0.2 (build 9506) EBF.  It is available for download at
http://downloads.sybase.com.

Dwprint.ini
The dwprint.ini contains the following sections:

- Windows - contains current printer setup information
- Devices - contains current configured devices
- Ports - contains current configured spool commands
- Printer configuration section

Default Printer
The default printer is defined in the Windows section. 

[windows]
device=hpsi,PostScript,pr-con6-09
MinDlgFontSize=12
DlgFontWeight=400

Workaround
The workaround is to create a copy of the dwprint.ini and change the default printer to a new value.   When you want to redirect a report to a different printer, execute a Unix shell script (from a PowerBuilder component) that will copy the new ini file to dwprint.ini.

1.  Edit the default printer in the dwprint.ini and save it to save.dwprint.ini.

device=hpsi,PostScript,colorpr

2. Create a Unix shell script called copyinifile.  The following is an example of a script where the new file is
copied to dwprint.ini.

#!/bin/sh
JAGUAR=/export/Sybase/EAServer export JAGUAR
d1=$JAGUAR
d2=$1
d3=$d1"/bin/"$d2
cp `echo $d3` $JAGUAR/bin/dwprint.ini

3. Create a new function in a PowerBuilder component that will run the shell script:

The example that follows is the f_copy function in the n_printsolaris component. It uses the PowerBuilder
run() function to execute the shell script copyinifile.  The shell script takes 1 argument "save.dwprint.ini"
and copies save.dwprint.ini to dwprint.ini.
 
n_printsolaris/f_copy
run("/export/Sybase/EAServer/bin/copyinifile  save.dwprint.ini")

4.  Now you can call the datastore.print() and the report will now print to a
different printer.

Summary
Use the Solaris admintool to first setup the printers on the machine.  For more details about
setting up the dwprint.ini, see the readme.txt included with the PB 8.0.2 (build 9506) EBF.
A sample shell script and dwprint.ini file are included in the zip file for download.


 

DOCUMENT ATTRIBUTES
Last Revised: Oct 25, 2002
Product: EAServer, PowerBuilder
Technical Topics: DataWindows, Install/Upgrade, Application Servers, Distributed Computing, Application Development, Component-based Development, Internet Application Development
  
Business or Technical: Technical
Content Id: 1021192
Infotype: Technote
 
 
 

© Copyright 2014, Sybase Inc. - v 7.6 Home / Contact Us / Help / Jobs / Legal / Privacy / Code of Ethics