Skip to content

PaperOrientation - cDRReport

Methods - Properties - Events

Method Type

Function

Return Type

Integer

Arguments

Argument Description
sReportID ID of the report. Can be ID of the main report or the ID of a sub-report. This argument can be passed as an empty string. The empty string can be written as C_USEMAINDRREPORTID.

Description

Retrieves the paper orientation of the report. The possible values are DMORIENT_PORTRAIT and DMORIENT_LANDSCAPE. These constants are defined in cPrintDialog.h.pkg.

This method cannot be used before the report OCX object is initialized. The COM object creation is - when not done before - created as part of the OpenReport method.

DataFlex Framework usage

  • Web
  • Windows
  • FlexTron

Sample

Object oReport is a cDRReport
    Set psReportName to 'MyReport.dr'
End_Object

Object oPrintReportButton is a Button
    Set Label to 'Print Report'

    Procedure OnClick
        String sReportId
        Integer eOrientation iResult
        Handle hPrinterDlg hoPrintDialog

        Get OpenReport of oReport to sReportId
        If (sReportId <> '') Begin
            Get PaperOrientation Of oReport sReportId to eOrientation
            Get phoPrintDialog of oReport to hoPrintDialog
            Set peOrientation of hoPrintDialog to eOrientation
            Get PrintDialog of hoPrintDialog to iResult
            If (iResult = PD_RESULT_PRINT) Begin
                Get phPrintDlg of hoPrintDialog to hPrinterDlg
                Send PrintReport Of oReport hPrinterDlg
            End
            Send CloseReport of oReport sReportId
        End
    End_Procedure
End_Object