Skip to content

SetDefaultPreviewerClass - cDRReport

Methods - Properties - Events

Method Type

Procedure

Arguments

None

Description

Gets the phcPreviewer property value. If the value is zero, it will be set to the cDRPreview class if the pePreviewStyle is set to C_DRPREVIEW_VIEW and set to the cDRToolPanelPreview class if the pePreviewStyle is set to C_DRPREVIEW_TOOLPANEL.

The phcPreviewer property is used for MDI style report result and tool panel dialogs.

The class or the parent object for the object created as an instance of the class MUST support:

  • Properties
  • phoReport
  • Label
  • Methods
  • Activate_View
  • UpdateViewer

The class should have some object that can register its window_handle with the cDRReport object via PreviewWindowHandle. This is a private property of the cDRReport class, which means one needs to study existing code when a custom class is desired.

The method is called when the pePreviewStyle property is set and can be augmented to set a different class.

DataFlex Framework usage

  • Windows
  • Windows controls in a FlexTron application

Sample

Class cMyOutputDialog is a ModalDialog
End_Class

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

    Procedure SetDefaultPreviewerClass
        Set phcPreviewer to (RefClass (cMyOutputDialog))
    End_Procedure
End_Object

Object oCountSubReportsButton is a Button
    Set Label to 'Count Subreports'

    Procedure OnClick
        Get RunReport of oReport
    End_Procedure
End_Object