Skip to content

ParentReportId - cDRReport

Methods - Properties - Events

Method Type

Function

Return Type

String

Arguments

Argument Description
sParentReportID ID of a report. Must be ID of a report
sReportId The report ID of the sub-report to be found

Description

Returns the parent report ID of a certain sub-report. Pass on initial call the psReportId of the cDRReport object as sParentReportId and the report ID of the sub-report as sReportID. The function is called recursively.

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.

DataFlex Framework usage

  • Web
  • Windows
  • FlexTron

Sample

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

Object oFindParentReportButton is a Button
    Set Label to 'Find Parent Report'

    Procedure OnClick
        String sReportId sSubReportId sParentReportId

        Get OpenReport of oReport to sReportId
        If (sReportId <> '') Begin
            Get SubReportIdByName of oReport "Orders Subreport" to sSubReportId
            If (sSubReportId <> "") Begin
                Send ParentReportId of oReport sReportId sSubReportId To sParentReportId
            End
        End
    End_Procedure
End_Object