Previous Next

SYSTEM-DIALOG PRINTER-SETUP statement

(Windows only)
Displays the Windows Print dialog box and lets the user set the default print context for subsequent print jobs in Windows.
Note:
Syntax 
 
SYSTEM-DIALOG PRINTER-SETUP
  [ NUM-COPIES expression ]
  [ LANDSCAPE | PORTRAIT ]
  [ UPDATE status ]
  [ IN WINDOW window ]
NUM-COPIES expression
Specifies the initial value of the Copies field in the Print dialog box. The value expression must evaluate to an integer expression. The user can change this value within the dialog box. This option is supported only with printer drivers that support multi-copy printing. Otherwise, the Copies field is disabled.
LANDSCAPE
Specifies the initial value of the Orientation field in the Properties dialog box as landscape. The user can change this value within the dialog box. The Properties dialog box is accessible from the Print dialog box. This option is supported only with printer drivers that support landscape page orientation.
PORTRAIT
Specifies the initial value of the Orientation field in the Properties dialog box as portrait. The user can change this value within the dialog box. The Properties dialog box is accessible from the Print dialog box. This option is supported only with printer drivers that support portrait page orientation.
UPDATE status
Specifies a logical variable to return the status of the user’s dialog interaction. If the user chooses the OK button, the dialog sets status to TRUE. If the user chooses the Cancel button, the dialog sets status to FALSE.
IN WINDOW window
Specifies the window from which the Print dialog box is displayed. The value window must be the handle of a window.
Example 
This example presents a dialog box that allows you to set up and print information from the sports database. When you choose the Printer Setup button, it displays the Windows Print dialog box. Using the latest settings, you can then print a list of customer names from the sports database in alphabetical order by choosing the Print Customer Names button.
 
DEFINE BUTTON bprintset   LABEL "Printer Setup".
DEFINE BUTTON bprintnames LABEL "Print Customer Names".
DEFINE BUTTON bcancel     LABEL "Cancel".
 
DEFINE FRAME PrintFrame 
  bprintset bprintnames bcancel
  WITH TITLE "Quick Printer" VIEW-AS DIALOG-BOX.
 
ON CHOOSE OF bprintset DO:
  SYSTEM-DIALOG PRINTER-SETUP.
END.
 
ON CHOOSE OF bprintnames DO:
  OUTPUT TO PRINTER.
  FOR EACH Customer NO-LOCK BY Customer.Name:
    DISPLAY Customer.Name WITH STREAM-IO.
  END.
  OUTPUT CLOSE.
END.
 
ENABLE ALL WITH FRAME PrintFrame.
WAIT-FOR CHOOSE OF bcancel IN FRAME PrintFrame.
Notes 
*
*
*
See also 
OUTPUT TO statement, SESSION system handle

Previous Next
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates.