Navigation: Language Reference > 13 - Built-in Functions >====== PRINTERDIALOGA (PRINTERDIALOG variant for opened report) ====== | |
PRINTERDIALOGA( [title] [,flag] [,prn] )
PRINTERDIALOGA | Displays the Windows standard printer choice dialog box to allow the user to select or configure a printer. |
title | A string constant or variable containing the title to place on the file choice dialog. If omitted, a default title is supplied by Windows. |
flag | A numeric constant or variable which displays a target Print dialog based on the flag's value: |
0 = Choose Printer dialog | |
1 = Print Setup dialog | |
2 = Page Setup dialog | |
prn | A label or reference to an opened REPORT or built-in variable PRINTER |
The PRINTERDIALOGA procedure displays the Windows standard printer choice dialog box, Print Setup dialog, or Page Setup dialog based on the flag value and returns the printer chosen by the user in the PRINTER “built-in” variable in the internal library. This sets the default printer used for the next REPORT opened. Optionally, this variant of PRINTERDIALOG aallows you to invoke the Print and the Printer Setup dialogs for an opened report. If the last parameter is omitted, PRINTERDIALOGA is identical to PRINTERDIALOG, or if the second parameter is set to 2.
PRINTERDIALOGA returns zero (0) if the user pressed the Cancel button, or one (1) if the user pressed the Ok button on the dialog.
Return Data Type: SIGNED
Example:
CustRpt REPORT,AT(1000,1000,6500,9000),THOUS,FONT('Arial',12),PRE(Rpt)
!Report structures and controls
END
CODE
!Initialization code here
OPEN(CustRpt)
!Choose printer for opened CustRpt
IF NOT PRINTERDIALOGA('Choose Printer',0,CustRpt)
RETURN !Abort if user pressed Cancel
END
See also: PRINTERDIALOG