Skip to content

psPrinterName - cDRReport

Methods - Properties - Events

Type

String

Default

None

Arguments

None

Description

The exact name of the printer can be specified in this property if the report output needs to be sent to a printer and the printer selection dialog should be bypassed while printing should not be sent to the default printer.

If a printer is found with the specified name, the output will be sent to this printer. If no printer with this name exists, the normal print dialog is opened, allowing the user to select a printer or cancel the print operation.

The hPrinterDlg parameter of the PrintReport method needs to be zero (default).

During PrintReport, the paper orientation and size are copied from the report to the print dialog object, which is accessible via the object handle in [phoPrintDialog](../both/phoprintdialog.md

Printing in a web application to a local printer should be done from the browser. Printing to a printer accessible via the web server should use this or the phPrintDlg property. The printer selection dialog is not opened at the server level.

DataFlex Framework usage

  • Web
  • Windows
  • FlexTron

Sample

Object oReport is a cDRReport
    Set psReportName to 'MyReport.dr'
    Set peOutputDestination to PRINT_TO_PRINTER
    Set psPrinterName to "Dell 2330dn Laser Printer"
End_Object

Object oOutputReportButton is a Button
    Set Label to 'Output Report'

    Procedure OnClick
        Send RunReport Of oReport
    End_Procedure
End_Object