# C1.Report.FlexReport.OnError

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Report_FlexReport_OnError_" data-uid="C1.Report.FlexReport.OnError*">OnError Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Report_FlexReport_OnError_" data-uid="C1.Report.FlexReport.OnError*"></a>
<h4 id="C1_Report_FlexReport_OnError" data-uid="C1.Report.FlexReport.OnError">OnError</h4>
<div class="markdown level1 summary"><p>Gets or sets the <b>VBScript</b> that is executed when an error occurs.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">[C1Category(&quot;Script&quot;)]
[C1Description(&quot;C1FlexReport.OnError&quot;, &quot;Script executed when an error occurs.&quot;)]
[Browsable(false)]
public string OnError { get; set; }</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">&lt;C1Category(&quot;Script&quot;)&gt;
&lt;C1Description(&quot;C1FlexReport.OnError&quot;, &quot;Script executed when an error occurs.&quot;)&gt;
&lt;Browsable(False)&gt;
Public Property OnError As String</code></pre>
</div>
<h5 id="C1_Report_FlexReport_OnError_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The control also fires the <a class="xref" href="C1.Report.FlexReport.ReportError.html">ReportError</a> event at this time.</p>
<p>The difference between the regular event and the VBScript property is that the handler for the regular event 
belongs to the application, and should thus be used to support tasks that are independent of the report.
For example, to display a an application dialog box when an error occurs.</p>
<p>The VBScript handler in the property belongs to the report, and will be executed regardless of the application.
For example, a report might contain a VBScript handler that changes the value of a field when an error occurs.</p>
</div>
</div>
