Skip to content

IsReportEngineBusy - 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

When the report engine (read: the OCX) is busy handling a report, it maintains its status internally. Re-entrance is not possible, and when functions such as OpenReport are used, the result of that operation is the same as when the report definition could not be loaded, which is an empty reportID.

This method can be used to determine whether there was an attempt to use the print engine in a re-entrant operation.

When can this re-entrance happen? If the application makes use of PumpMsgQueue or a similar operation and then a button click tries to use another report. Another example is when your application responds to a COM event (like OnProgressRecordsRead, OnProgressFormatPage) and starts a new report from there.

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 oOpenReportButton is a Button
    Set Label to 'Open Report'

    Procedure OnClick
        String sReportId

        Get OpenReport of oReport to sReportId
        If (sReportId = '') Begin
            Get IsReportEngineBusy of oReport to iRetval
            If (iRetval <> 0) Begin
                Error DFERR_OPERATOR 'Attempted to use the report engine in a re-enterant way'
            End
        End
    End_Procedure
End_Object