# GrapeCity.ActiveReports.SectionReport.LoadLayout

## Content

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



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



<a id="GrapeCity_ActiveReports_SectionReport_LoadLayout_" data-uid="GrapeCity.ActiveReports.SectionReport.LoadLayout*"></a>
<h4 id="GrapeCity_ActiveReports_SectionReport_LoadLayout_System_Type_System_String_" data-uid="GrapeCity.ActiveReports.SectionReport.LoadLayout(System.Type,System.String)">LoadLayout(Type, string)</h4>
<div class="markdown level1 summary"><p>Loads the report layout from the embedded resource.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void LoadLayout(Type type, string resourceName)</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.type">Type</a></td>
      <td><span class="parametername">type</span></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.type">Type</a> value from the assembly containing the embedded resource.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">resourceName</span></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a> value representing the name of the embedded resource.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_SectionReport_LoadLayout_System_Type_System_String__examples">Examples</h5>
<pre><code class="lang-csharp">var sectionReport = new GrapeCity.ActiveReports.SectionReport();
sectionReport.LoadLayout(typeof(SectionReport), "resourceName"); 
sectionReport.Document.Printer.PrinterName = String.Empty;
viewer.LoadDocument(sectionReport);</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="GrapeCity.ActiveReports.ReportException.html">ReportException</a></td>
      <td><p>Thrown if <code class="paramref">resourceName</code> cannot loaded.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_ActiveReports_SectionReport_LoadLayout_" data-uid="GrapeCity.ActiveReports.SectionReport.LoadLayout*"></a>
<h4 id="GrapeCity_ActiveReports_SectionReport_LoadLayout_System_Xml_XmlReader_" data-uid="GrapeCity.ActiveReports.SectionReport.LoadLayout(System.Xml.XmlReader)">LoadLayout(XmlReader)</h4>
<div class="markdown level1 summary"><p>Loads the report layout from the <span class="xref">System.Xml.XmlReader</span>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void LoadLayout(XmlReader reader)</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><span class="xref">XmlReader</span></td>
      <td><span class="parametername">reader</span></td>
      <td><p>A <span class="xref">System.Xml.XmlReader</span> value with which to load the layout.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_SectionReport_LoadLayout_System_Xml_XmlReader__examples">Examples</h5>
<pre><code class="lang-csharp">var sectionReport = new GrapeCity.ActiveReports.SectionReport();
var reader = System.Xml.XmlReader.Create("Report.rpx");
sectionReport.LoadLayout(reader);
sectionReport.Document.Printer.PrinterName = String.Empty;
reader.Close();</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="GrapeCity.ActiveReports.ReportException.html">ReportException</a></td>
      <td><p>Thrown if the <code class="paramref">reader</code> is null.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_ActiveReports_SectionReport_LoadLayout_" data-uid="GrapeCity.ActiveReports.SectionReport.LoadLayout*"></a>
<h4 id="GrapeCity_ActiveReports_SectionReport_LoadLayout_System_String_" data-uid="GrapeCity.ActiveReports.SectionReport.LoadLayout(System.String)">LoadLayout(string)</h4>
<div class="markdown level1 summary"><p>Loads the report layout from the file.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">[Obsolete(&quot;This method has been deprecated. Please, use LoadLayout(XmlReader) method instead&quot;)]
public void LoadLayout(string fileName)</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">fileName</span></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a> value representing the name of the file containing the layout.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_SectionReport_LoadLayout_System_String__examples">Examples</h5>
<pre><code class="lang-csharp">var sectionReport = new GrapeCity.ActiveReports.SectionReport();
sectionReport.LoadLayout("Report.rpx");
sectionReport.Document.Printer.PrinterName = String.Empty;
viewer.LoadDocument(sectionReport);</code></pre>



<a id="GrapeCity_ActiveReports_SectionReport_LoadLayout_" data-uid="GrapeCity.ActiveReports.SectionReport.LoadLayout*"></a>
<h4 id="GrapeCity_ActiveReports_SectionReport_LoadLayout_System_String_System_Collections_ArrayList__" data-uid="GrapeCity.ActiveReports.SectionReport.LoadLayout(System.String,System.Collections.ArrayList@)">LoadLayout(string, out ArrayList)</h4>
<div class="markdown level1 summary"><p>Loads report's layout from file.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">[Obsolete(&quot;This method has been deprecated. Please, use LoadLayout(XmlReader) method instead&quot;)]
public void LoadLayout(string fileName, out ArrayList errors)</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">fileName</span></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a> value representing the name of the file containing the layout.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.arraylist">ArrayList</a></td>
      <td><span class="parametername">errors</span></td>
      <td><p>An <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.arraylist">ArrayList</a>value used to store layout validation errors encountered during the loading process.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_SectionReport_LoadLayout_System_String_System_Collections_ArrayList___examples">Examples</h5>
<pre><code class="lang-csharp">SectionReport sectionReport = new GrapeCity.ActiveReports.SectionReport();
sectionReport.LoadLayout("Report.rpx", out System.Collections.ArrayList error);
sectionReport.Document.Printer.PrinterName = String.Empty;
viewer.LoadDocument(sectionReport);</code></pre>



<a id="GrapeCity_ActiveReports_SectionReport_LoadLayout_" data-uid="GrapeCity.ActiveReports.SectionReport.LoadLayout*"></a>
<h4 id="GrapeCity_ActiveReports_SectionReport_LoadLayout_System_IO_Stream_" data-uid="GrapeCity.ActiveReports.SectionReport.LoadLayout(System.IO.Stream)">LoadLayout(Stream)</h4>
<div class="markdown level1 summary"><p>Loads the report layout from the stream.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">[Obsolete(&quot;This method has been deprecated. Please, use LoadLayout(XmlReader) method instead&quot;)]
public void LoadLayout(Stream stream)</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.io.stream">Stream</a></td>
      <td><span class="parametername">stream</span></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a> value containing the layout.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_SectionReport_LoadLayout_System_IO_Stream__examples">Examples</h5>
<pre><code class="lang-csharp">SectionReport sectionReport = new SectionReport();
using (XmlTextReader reader = new XmlTextReader("Report.rpx"))
{
	sectionReport.LoadLayout(reader);
}
sectionReport.Document.Printer.PrinterName = String.Empty;
viewer.LoadDocument(sectionReport);</code></pre>



<a id="GrapeCity_ActiveReports_SectionReport_LoadLayout_" data-uid="GrapeCity.ActiveReports.SectionReport.LoadLayout*"></a>
<h4 id="GrapeCity_ActiveReports_SectionReport_LoadLayout_System_IO_Stream_System_Collections_ArrayList__" data-uid="GrapeCity.ActiveReports.SectionReport.LoadLayout(System.IO.Stream,System.Collections.ArrayList@)">LoadLayout(Stream, out ArrayList)</h4>
<div class="markdown level1 summary"><p>Loads the report layout from the stream.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">[Obsolete(&quot;This method has been deprecated. Please, use LoadLayout(XmlReader) method instead&quot;)]
public void LoadLayout(Stream stream, out ArrayList errors)</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.io.stream">Stream</a></td>
      <td><span class="parametername">stream</span></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a> value containing the layout.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.arraylist">ArrayList</a></td>
      <td><span class="parametername">errors</span></td>
      <td><p>An <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.arraylist">ArrayList</a>value used to store layout validation errors encountered during the loading process.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_SectionReport_LoadLayout_System_IO_Stream_System_Collections_ArrayList___examples">Examples</h5>
<pre><code class="lang-csharp">SectionReport sectionReport = new SectionReport();
using (XmlTextReader reader = new XmlTextReader("Report.rpx"))
{
	sectionReport.LoadLayout(reader, out System.Collections.ArrayList error);
}
sectionReport.Document.Printer.PrinterName = String.Empty;
viewer.LoadDocument(sectionReport);</code></pre>

</div>
