# C1.Report.FlexReport.Execute

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Report_FlexReport_Execute_" data-uid="C1.Report.FlexReport.Execute*">Execute Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Report_FlexReport_Execute_" data-uid="C1.Report.FlexReport.Execute*"></a>
<h4 id="C1_Report_FlexReport_Execute_System_String_" data-uid="C1.Report.FlexReport.Execute(System.String)">Execute(string)</h4>
<div class="markdown level1 summary"><p>Executes a <b>VBScript</b> statement in the current report context.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Execute(string statement)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Execute(statement As String)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">statement</span></td>
      <td><p>A string with <b>VBScript</b> instructions to be executed.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Report_FlexReport_Execute_System_String__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This method is similar to the <a class="xref" href="C1.Report.FlexReport.Evaluate.html#C1_Report_FlexReport_Evaluate_System_String_">Evaluate(string)</a> method, except it does not return a value.</p>
<p>If the <b>expression</b> string contains invalid syntax or causes an evaluation error, the control 
raises the <a class="xref" href="C1.Report.FlexReport.ReportError.html">ReportError</a> event. In this case, the <i>Handled</i> parameter of the event
is set to true, so the exception is ignored by default.</p>
</div>


<a id="C1_Report_FlexReport_Execute_" data-uid="C1.Report.FlexReport.Execute*"></a>
<h4 id="C1_Report_FlexReport_Execute_System_String_C1_Report_IReportScriptContext_" data-uid="C1.Report.FlexReport.Execute(System.String,C1.Report.IReportScriptContext)">Execute(string, IReportScriptContext)</h4>
<div class="markdown level1 summary"><p>Executes a <b>VBScript</b> statement.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Execute(string statement, IReportScriptContext context)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Execute(statement As String, context As IReportScriptContext)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">statement</span></td>
      <td><p>A string with <b>VBScript</b> instructions to be executed.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Report.IReportScriptContext.html">IReportScriptContext</a></td>
      <td><span class="parametername">context</span></td>
      <td><p><a class="xref" href="C1.Report.IReportScriptContext.html">IReportScriptContext</a> interface used to obtain objects available in expression.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
