| **Navigation:**  [[introduction.htm|Language Reference]] > 13 - Built-in Functions >====== PRINTERDIALOG (return chosen printer) ====== | [[print print a report structure .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[printerdialoga extended variant of prniterdialog .htm|{{btn_next_n.gif|Next page}}]] | | || **PRINTERDIALOG(** [//title//] [,//flag//] **)** {{blk2blue.jpg|blk2blue.jpg}} | **PRINTERDIALOG** | 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 | The **PRINTERDIALOG** 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. PRINTERDIALOG 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** ** IF NOT ****PRINTERDIALOG****('Choose Printer')** **  RETURN                 !Abort if user pressed Cancel** ** END** ** OPEN(CustRpt)** **See also:** [[printerdialoga extended variant of prniterdialog .htm|PRINTERDIALOGA]]