Skip to content

ReportIdForFunction - cDRReport

Methods - Properties - Events

Method Type

Function

Return Type

tReportFunctionId

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.
sFunctionName Name of the function to find.

Description

Uses FunctionIdByName for the passed report identifier and is identical in that respect. However, if the report does not have a function with the specified function name, all sub-reports of the report are iterated, including the sub-reports of those sub-reports.

The return value is a tReportFunctionId struct that contains the (sub) report ID and the function's ordinal number.

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

DataFlex Framework Usage

  • Web
  • Windows
  • FlexTron

Sample

Object oReport is a cDRReport
    Set psReportName to "customer with subreport.dr"

    Procedure OnInitializeReport
        String sReportId
        tReportFunctionId FunctionLocation

        Get psReportId to sReportId

        Get ReportIdForFunction sReportId "customernumber" to FunctionLocation
        If (FunctionLocation.iFunction <> -1) Begin
            Set psFunction FunctionLocation.sReportId "customernumber" to "return ('{customer.number}=100')"
        End
    End_Procedure
End_Object