Consultor Eletrônico



Kbase P6531: _osprint ignores the new session:printer-name
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   04/02/2005
Status: Unverified

FACT(s) (Environment):

Progress 9.x

SYMPTOM(s):

_osprint ignores the new session:printer-name

'output to <printer>' works

CAUSE:

The following line of code within _osprint.p ignores the session printer

"ASSIGN SESSION:PRINTER-CONTROL-HANDLE = ?."

FIX:

This is a workaround which avoids the use of osprint. However, it only works with text files.

DEFINE STREAM In_Stream.
DEFINE STREAM Out_Stream.

DEFINE VARIABLE List AS CHARACTER NO-UNDO.
DEFINE VARIABLE n AS CHARACTER NO-UNDO.
list = SESSION:GET-PRINTERS().
n = ENTRY(3,list).

RUN PrintFile("dorder.i",n).

PROCEDURE PrintFile:
DEFINE INPUT PARAMETER p_PrintFile AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER PrinterName AS CHARACTER NO-UNDO.
DEFINE VAR Text_Line AS CHARACTER FORMAT "x(255)" NO-UNDO .

INPUT STREAM In_Stream FROM VALUE(p_PrintFile) NO-ECHO NO-MAP.
OUTPUT STREAM Out_Stream TO PRINTER VALUE(PrinterName).

/* Frame must be down frame, so scope to REPEAT. */
REPEAT ON STOP UNDO, LEAVE WITH FRAME f_Print:
IMPORT STREAM In_Stream UNFORMATTED Text_Line.
DISPLAY STREAM Out_Stream Text_Line
WITH FRAME f_Print NO-LABELS STREAM-IO
NO-BOX USE-TEXT WIDTH 255.
END.

INPUT STREAM In_Stream CLOSE.
OUTPUT STREAM Out_Stream CLOSE.
END PROCEDURE.