Get the selected printer device name

From DataFlex Wiki
Revision as of 11: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.

    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