Skip to content

OCXVersion - cDRReport

Methods - Properties - Events

Method Type

Function

Return Type

String

Arguments

None

Description

This function returns the version number of the loaded DataFlex Reports OCX. The version can be compared with the constant C_DR_OCX_VERSION.

This method cannot be used before the report OCX object is initialized. The COM object creation is performed as part of the OpenReport method if it has not been done beforehand.

The example dynamically creates a cDRReport object, calls the OCXVersion function, and then destroys the object.

DataFlex Framework usage

  • Web
  • Windows
  • FlexTron

Sample

Object oOCXVersionMenuItem is a cCJMenuItem
    Set psCaption to "OCX Version"
    Set psTooltip to "OCX Version"

    Procedure OnExecute Variant vCommandBarControl
        Handle hoReport
        String sVersion

        Get Create (RefClass (cDRReport)) to hoReport
        Send CreateComObject of hoReport
        Get OCXVersion of hoReport to sVersion
        Send ReleaseComObject of hoReport
        Send Info_Box ("OCX: " + C_DR_OCX_NAME + " version is: " + sVersion + "\ncDRReport.Pkg is for OCX version: " + C_DR_OCX_VERSION) "Versions"
        Send Destroy of hoReport
    End_Procedure
End_Object