Get the selected printer device name

From DataFlex Wiki
Revision as of 12:34, 15 September 2022 by Wil (talk | contribs) (Created page with "DataFlex Reports has a class cPrintDialog which you can use to popup a printer dialog and then retrieve the selected printer from. <source lang="dataflex"> 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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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