# GrapeCity.ActiveReports.SectionReport.Run

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_ActiveReports_SectionReport_Run_" data-uid="GrapeCity.ActiveReports.SectionReport.Run*">Run Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_ActiveReports_SectionReport_Run_" data-uid="GrapeCity.ActiveReports.SectionReport.Run*"></a>
<h4 id="GrapeCity_ActiveReports_SectionReport_Run" data-uid="GrapeCity.ActiveReports.SectionReport.Run">Run()</h4>
<div class="markdown level1 summary"><p>Generates the report output that could be then printed, displayed in the viewer, or exported to an external document.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Run()</code></pre>
</div>
<h5 id="GrapeCity_ActiveReports_SectionReport_Run_examples">Examples</h5>
<pre><code class="lang-csharp">var sectionReport = new GrapeCity.ActiveReports.SectionReport();
XmlTextReader xtr = new XmlTextReader(reportName);
sectionReport.LoadLayout(xtr);
sectionReport.Document.Printer.PrinterName = String.Empty;
sectionReport.Run();
IDocumentExport documentExportEx = new GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport();
using (var stream = new FileStream(fileName, FileMode.Create))
documentExportEx.Export(sectionReport.Document, stream);</code></pre>

<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.licenseexception">LicenseException</a></td>
      <td><p>Thrown if a component cannot be licensed.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.ActiveReports.ReportException.html">ReportException</a></td>
      <td><p>Thrown if something is wrong with the report structure.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_ActiveReports_SectionReport_Run_" data-uid="GrapeCity.ActiveReports.SectionReport.Run*"></a>
<h4 id="GrapeCity_ActiveReports_SectionReport_Run_System_Boolean_" data-uid="GrapeCity.ActiveReports.SectionReport.Run(System.Boolean)">Run(bool)</h4>
<div class="markdown level1 summary"><p>Generates the report output that could be then printed, displayed in the viewer, or exported to an external document.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Run(bool syncDocument)</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.boolean">bool</a></td>
      <td><span class="parametername">syncDocument</span></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a> value that determines whether to execute UI events. Set to <code>true</code> if UI events should be executed, otherwise set to <code>false</code>.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_SectionReport_Run_System_Boolean__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This method should be used only inside WindowsForms applications in the UI thread (to ensure it won't be blocked long time).</p>
</div>
<h5 id="GrapeCity_ActiveReports_SectionReport_Run_System_Boolean__examples">Examples</h5>
<pre><code class="lang-csharp">var sectionReport = new GrapeCity.ActiveReports.SectionReport();
XmlTextReader xtr = new XmlTextReader(reportName);
sectionReport.LoadLayout(xtr);
sectionReport.Document.Printer.PrinterName = String.Empty;
sectionReport.Run(true);
IDocumentExport documentExportEx = new GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport();
using (var stream = new FileStream(fileName, FileMode.Create))
    documentExportEx.Export(sectionReport.Document, stream);</code></pre>

<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.licenseexception">LicenseException</a></td>
      <td><p>Thrown if a component cannot be licensed.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.ActiveReports.ReportException.html">ReportException</a></td>
      <td><p>Thrown if something is wrong with the report structure.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
