Skip to content

psDeviceName Usage

The following code example shows how to use the psDeviceName.

Object oOrderReport is a cDRReport
    Set pbShowStatusPanel to True
    Set phoStatusPanel to oDRStatusPanel
    Set psReportName to "Orders with Pagelayers.dr"
    Set peOutputDestination to PRINT_TO_Printer

    Procedure OnCreate
        String sReportId
        Forward Send OnCreate
        Get psReportId to sReportId
        Set piReportLanguage sReportId to LANG_DEFAULT
    End_Procedure

    Procedure OnInitializeReport
        Forward Send OnInitializeReport
        Send SetFilters
        Send SetParameters
        Send SetDefaultPrinter
    End_Procedure

    Procedure SetDefaultPrinter
        Handle hoPrintDialog
        Get phoPrintDialog to hoPrintDialog
        Set psDeviceName of hoPrintDialog to "Microsoft Print to PDF"
    End_Procedure