Kbase P23975: 4GL/ABL: OUTPUT TO PRINTER PAGE-SIZE 0 on Windows sets the PAGE-SIZE to 56
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  17/04/2009 |
|
Status: Verified
SYMPTOM(s):
4GL/ABL: OUTPUT TO PRINTER PAGE-SIZE 0 on Windows sets the PAGE-SIZE to 56
OUTPUT TO PRINTER PAGE-SIZE 0 on Windows clients appends a form feed at the end of the output stream.
FACT(s) (Environment):
Windows
Progress 9.x
OpenEdge 10.x
CAUSE:
This is expected behavior. The documentation of the PAGE-SIZE option of the OUTPUT TO statement states that when the PAGE-SIZE 0 option is used, output will not be paged in character mode. However, in a graphical interface the default page size is used.
FIX:
Output to a text file instead of the printer, then use the OS-COPY statement to copy the text file directly to the printer. For example:
DEFINE VARIABLE cFileName AS CHARACTER NO-UNDO.
DEFINE VARIABLE cPrinterPort AS CHARACTER NO-UNDO.
ASSIGN
cFileName = SESSION:TEMP-DIR + "my-file-name" + ".txt"
cPrinterPort = SESSION:PRINTER-PORT.
&IF "{&WINDOW-SYSTEM}" = "TTY" &THEN
OUTPUT TO PRINTER PAGE-SIZE 0.
&ELSE
OUTPUT TO VALUE(cFileName).
&ENDIF
PUT UNFORMATTED "this is the text that will be output unpaged without a terminating form feed character".
OUTPUT CLOSE.
&IF "{&WINDOW-SYSTEM}" <> "TTY" &THEN
OS-COPY VALUE(cFileName) VALUE(cPrinterPort).
OS-DELETE VALUE(cFileName).
&ENDIF