Consultor Eletrônico



Kbase P16956: How to print to a USB printer using 4GL?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   24/07/2008
Status: Verified

GOAL:

How to print to a USB printer.

FACT(s) (Environment):

Progress 9.x
OpenEdge 10.x

FIX:

The following 4GL OUTPUT statement should be used to print to a USB printer:

OUTPUT TO PRINTER "<PrinterName>" or if the printer is local
OUTPUT TO PRINTER "<UNCPrinterName>" if the printer is shared networked
where <PrinterName> is the local or network UNC printer name. In the following example, it is assumed that the USB printer is the session printer:


DEFINE VARIABLE i AS INTEGER NO-UNDO.
DEFINE VARIABLE c AS CHARACTER NO-UNDO.

ASSIGN c = SESSION:PRINTER-NAME.

OUTPUT TO PRINTER VALUE(c).

REPEAT WHILE i < 10:
DISPLAY "This is test line number " i.
ASSIGN i = i + 1.
END.

OUTPUT CLOSE.