Skip to content

pbDisplayError - cDRReport

Methods - Properties - Events

Type

Boolean

Default

True

Arguments

None

Description

Determines if errors will be displayed during the execution of the report.

For the display of the errors, the standard DataFlex error handler system will be used by sending Error_Report of the object whose ID was in the global Error_Object_Id variable prior to a method execution.

The code in the example below shows the use of error logging in case errors are not displayed.

DataFlex Framework usage

  • Windows
  • FlexTron

Sample

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

    Procedure OnError Integer iErrNum Integer iErrLine String sErrMsg
        Boolean bDisplayError
        Integer iChannel

        Get pbDisplayError to bDisplayError
        If (not (bDisplayError)) Begin
            Move (Seq_New_Channel ()) to iChannel
            If (iChannel >= DF_SEQ_CHANNEL_MIN and iChannel <= DF_SEQ_CHANNEL_MAX) Begin
                Append_Output channel iChannel "DRError.Log"
                Writeln Channel iChannel (CurrentDateTime()) ' #:' iErrNum ' at: ' iErrLine ' "' sErrMsg '"'
                Close_Output Channel iChannel
                Send Seq_Release_Channel iChannel
            End
        End
    End_Procedure
End_Object

Object oRunReportButton is a Button
    Set Label to 'Run Report'

    Procedure OnClick
        Set pbDisplayError of oReport to False
        Send RunReport of oReport
    End_Procedure
End_Object