pbHasErrors - cDRReport¶
Methods - Properties - Events
Type¶
Default¶
False
Arguments¶
None
Description¶
If an error occurred during report execution or loading, the value of this property will be True, allowing your code to make decisions based on this state.
The OnError event can be utilized to log errors, as demonstrated in the sample code below.
DataFlex Framework usage¶
- Web
- Windows
- FlexTron
Sample¶
Object oReport is a cDRReport
// invoke an error with a non-existent report
Set psReportName to 'NonExistentReport.dr'
Procedure OnError Integer iErrNum Integer iErrLine String sErrMsg
Set pbDisplayError To False
Send WriteToLogFile iErrNum iErrLine sErrMsg
End_Procedure
End_Object
Object oRunReportButton is a Button
Set Label to 'Run Report'
Procedure OnClick
Boolean bHasErrors
Send RunReport of oReport
Get pbHasErrors of oReport to bHasErrors
If (bHasErrors) Begin
Send Info_Box 'An error occurred'
End
End_Procedure
End_Object