Description

The TERM message is used to end a printing session. The TERM message is required to close the printing job, destroy the printing dialog box, and clean up resources. If the Print Preview window is visible, then the TERM message finishes the printing and activates the Print Preview window. All of the information that was set with the Set_Printer() function (fonts, headers, footers, and column information) will be reset. The INIT and TERM messages may be called multiple times to print several separate reports, but make sure there is a TERM message for every INIT message. Only one printing session can be open at a time, therefore each INIT message must have a matching TERM message before another printing session is started.

Parameters

The Close parameter determines when the OIPI engine is closed. If Close is 0, NULL, or unassigned, then the OIPI engine is not closed after the TERM or when the Print Preview is closed. If Close is 1, then the OIPI engine is closed when the TERM message is called (for reports going straight to the printer) or when the Print Preview is closed. If Close is 2, then the OIPI print engine is immediately closed and the Print Preview is closed.

You should call the TERM message with Close set to 0 or unassigned at the end of most reports, because your reports will print much faster it the OIPI engine does not need to close and start up between each report. Then call the TERM with Close equal to 2 when your OpenInsight application closes, just to make sure the OIPI is not left open.

ParameterDescription of FieldsCommentsDefault
Parm1 - Close<1> Close

Determines how the OIPI engine closes

0=Not Closed

1=Closed after TERM or when the Print Preview is closed

2=Immediate Close

0

See also

INIT Set_Printer Message

Example

/*The following example shows to use the TERM message. */
 
declare function Set_Printer
stat = Set_Printer("INIT") ;* Start printing
stat = Set_Printer("TEXT", "Test 1 2 3") ;* Print text
stat = Set_Printer("TERM") ;* End printing
  • No labels