printerAssociation

The system variable ConverseVar.printerAssociation allows you to specify, at run time, the output destination when you print a print form.

You can use this variable in any of these ways:
Characteristics of ConverseVar.printerAssociation are as follows:
Primitive type
CHAR
Data length
Varies by file type
Is value always restored after a converse?
Yes

ConverseVar.printerAssociation is initialized to the system resource name specified during generation or for debugging. If a program passes control to another program, the value of ConverseVar.printerAssociation is set to the default value for the receiving program.

Even though multiple print jobs are allowed for a given print form, the close statement closes only the file related to the current value of ConverseVar.printerAssociation.

Details specific to Java output

For Java™ output, you set ConverseVar.printerAssociation to a two-part string with an intervening colon:
  jobID:destination
jobID
A sequence of characters (without a colon) that uniquely identifies each print job. The characters are case sensitive (job01 is different from JOB01), and you can reuse jobID after a print job closes.
You can use different jobs to promote a different kind of output or a different ordering of output, depending on the flow of events in your code. Consider the following sequence of EGL statements, for example:
  ConverseVar.printerAssociation = "job1"; 
  print form1;
  ConverseVar.printerAssociation = "job2";
  print form2;
  ConverseVar.printerAssociation = "job1";
  print form3;
When the program ends, two print jobs are created:
  • form1 followed by form3
  • form2 alone
destination
The printer or file that receives the output.
The string destination is optional and is ignored if the print job is still open. The following statements apply if the string is absent:
  • You can omit the colon that precedes destination
  • In most cases, the program shows a print preview dialog from which the user can specify a printer or a file for output. The exception occurs if the curses library is used on UNIX®; in that case, the print job goes to the default printer.
The following statements apply to the setting of destination when you are generating for Windows® 2000/NT/XP:
  • To send output to the default printer, do as follows--
    • Specify a value that matches the fileName property in the resource associations part.
    • Change the Java runtime properties so that spool (rather than seqws) is the value of the related file type. For example, in the resource associations part, if the value of the fileName property is myFile and the value of systemName is printer, you must change the settings of Java runtime properties so that vgj.ra.myFile.fileType is set to spool rather than seqws. After your change, the properties are as follows:
        vgj.ra.myFile.systemName=printer
        vgj.ra.myFile.fileType=spool
  • To send output to a file, specify a value that matches the fileName property in the resource associations part, when seqws is the value of the related fileType property in the resource associations part. The systemName property is the resource associations part contains the name of the operating-system file that receives the output.
  • Do not specify the value printer as the value of destination. If you do, the print preview dialog is displayed to the user, but that behavior may change in later versions of EGL.
The following statements apply to the setting of destination when you are generating for UNIX:
  • To send output to the default printer (regardless of whether the curses library is in use), specify a value that matches the fileName property in the resource associations part, when spool is the value of the related fileType property in the resource associations part.
  • To send output to a file, specify a value that matches the fileName property in the resource associations part, when seqws is the value of the related fileType property in the resource associations part. The systemName property in the resource associations part contains the name of the operating-system file that receives the output.
  • Do not specify the value printer as the value of destination. If you do (and if the curses library is not in use), the print preview dialog is displayed to the user, but that behavior may change in later versions of EGL.
Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.