Get the selected printer device name

DataFlex Reports has a class cPrintDialog which you can use to popup a printer dialog and then retrieve the selected printer from.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Object oPrintDialog is a cPrintDialog
End_Object
 
Object oPrint is a Button
    Set Location to 0 0
    Set Label to "Print"
 
    Procedure OnClick
        Integer iRes
        String  sPrntr
         
        Get PrintDialog of oPrintDialog to iRes
         
        If iRes Begin
            Get psDeviceName of oPrintDialog to sPrntr
             
            Direct_Output ("WinLST:" * sPrntr)
            Writeln "Hello World!"
            Close_Output
        End
         
    End_Procedure
 
End_Object

External links