# C1.Report.Section

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_Report_Section" data-uid="C1.Report.Section" class="text-break">Section Class
</h1>
  <div class="markdown level0 summary"><p>Represents a report band.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><a class="xref" href="C1.Report.ReportObject.html">ReportObject</a></div>
    <div class="level2"><a class="xref" href="C1.Report.VisualReportObject.html">VisualReportObject</a></div>
    <div class="level3"><span class="xref">Section</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="C1.Report.IScriptContextProvider.html">IScriptContextProvider</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.Report.html">C1.Report</a></h6>
  <h6><strong>Assembly</strong>: C1.Report.dll</h6>
  <h5 id="C1_Report_Section_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class Section : VisualReportObject, IScriptContextProvider</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class Section
    Inherits VisualReportObject
    Implements IScriptContextProvider</code></pre>
  </div>
  <h5 id="C1_Report_Section_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><p>
Each <a class="xref" href="C1.Report.Section.html">Section</a> object contains a collection of <a class="xref" href="C1.Report.SubSection.html">SubSection</a> objects.
</p>
<p>Every report contains the following sections:</p>
<p>A <b>detail</b> section.</p>
<p>A <b>report header</b> and a <b>report footer</b> section.</p>
<p>A <b>page header</b> and a <b>page footer</b> section.</p>
<p>A <b>group header</b> and a <b>group footer</b> section for each <a class="xref" href="C1.Report.Group.html">Group</a> object in the report.</p>
<p>The total number of sections in a report is therefore <pre><code class="lang-csharp">5 + 2 * Groups.Count</code></pre>. Sections cannot
be added and removed from reports directly. The number of sections is a function of the number of groups.
<p>Although sections cannot be removed, they can be hidden by setting their <a class="xref" href="C1.Report.Section.Visible.html#C1_Report_Section_Visible">Visible</a> property
to false.</p>
</div>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Report_Section_AutoHeight" data-uid="C1.Report.Section.AutoHeight">
          <a class="xref" href="C1.Report.Section.AutoHeight.html#C1_Report_Section_AutoHeight">AutoHeight</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value determining how the height of the section changes depending on its content.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_Section_Calculated" data-uid="C1.Report.Section.Calculated">
          <a class="xref" href="C1.Report.Section.Calculated.html#C1_Report_Section_Calculated">Calculated</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a value indicating whether the current section has already been calculated and its
<a class="xref" href="C1.Report.Section.RenderHeight.html#C1_Report_Section_RenderHeight">RenderHeight</a> property contains a valid value.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_Section_CanGrow" data-uid="C1.Report.Section.CanGrow">
          <a class="xref" href="C1.Report.Section.CanGrow.html#C1_Report_Section_CanGrow">CanGrow</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value indicating whether the section's height is automatically increased to fit its content.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_Section_CanShrink" data-uid="C1.Report.Section.CanShrink">
          <a class="xref" href="C1.Report.Section.CanShrink.html#C1_Report_Section_CanShrink">CanShrink</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value indicating whether the section's height should be reduced when one or more fields shrink.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_Section_Fields" data-uid="C1.Report.Section.Fields">
          <a class="xref" href="C1.Report.Section.Fields.html#C1_Report_Section_Fields">Fields</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a collection of all fields in this <a class="xref" href="C1.Report.Section.html">Section</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_Section_ForcePageBreak" data-uid="C1.Report.Section.ForcePageBreak">
          <a class="xref" href="C1.Report.Section.ForcePageBreak.html#C1_Report_Section_ForcePageBreak">ForcePageBreak</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value determining whether page breaks should be inserted before and/or after the section.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_Section_Height" data-uid="C1.Report.Section.Height">
          <a class="xref" href="C1.Report.Section.Height.html#C1_Report_Section_Height">Height</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the height of the current section in twips.
This is the sum of the heights of all sub-sections of the current section.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_Section_KeepTogether" data-uid="C1.Report.Section.KeepTogether">
          <a class="xref" href="C1.Report.Section.KeepTogether.html#C1_Report_Section_KeepTogether">KeepTogether</a>
        </td>
        <td class="markdown level1 summary"><p>Specifies whether the <a class="xref" href="C1.Report.Section.html">Section</a> should be kept together on a page.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_Section_Name" data-uid="C1.Report.Section.Name">
          <a class="xref" href="C1.Report.Section.Name.html#C1_Report_Section_Name">Name</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the <a class="xref" href="C1.Report.Section.html">Section</a> name.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_Section_OnFormat" data-uid="C1.Report.Section.OnFormat">
          <a class="xref" href="C1.Report.Section.OnFormat.html#C1_Report_Section_OnFormat">OnFormat</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a string containing <b>VBScript</b> code to be executed before the <a class="xref" href="C1.Report.Section.html">Section</a> is formatted.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_Section_OnPrint" data-uid="C1.Report.Section.OnPrint">
          <a class="xref" href="C1.Report.Section.OnPrint.html#C1_Report_Section_OnPrint">OnPrint</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a string containing <b>VBScript</b> code to be executed before the <a class="xref" href="C1.Report.Section.html">Section</a> is printed
(after it is formatted).</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_Section_ParentReport" data-uid="C1.Report.Section.ParentReport">
          <a class="xref" href="C1.Report.Section.ParentReport.html#C1_Report_Section_ParentReport">ParentReport</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the <a class="xref" href="C1.Report.FlexReport.html">FlexReport</a> object that contains this <a class="xref" href="C1.Report.Section.html">Section</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_Section_PrintAtPageBottom" data-uid="C1.Report.Section.PrintAtPageBottom">
          <a class="xref" href="C1.Report.Section.PrintAtPageBottom.html#C1_Report_Section_PrintAtPageBottom">PrintAtPageBottom</a>
        </td>
        <td class="markdown level1 summary"><p>For master report's footer sections only, gets or sets a value
indicating whether the current section should print at the bottom
of the page immediately above the page footer, rather than right
below the detail. The default is <b>false</b>.</p>
<p>
This property is ignored for non-footer sections or for footers
of sub-reports.
</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_Section_RenderHeight" data-uid="C1.Report.Section.RenderHeight">
          <a class="xref" href="C1.Report.Section.RenderHeight.html#C1_Report_Section_RenderHeight">RenderHeight</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the actual height of the current section.
This is the sum of the heights of all its sub-sections.
This property can only be used while the report is being rendered, otherwise it returns -1.</p>
<p>
Note that if this property is used in the section's OnFormat script, then it returns
the height calculated for the previous instance of the section, or -1 if this is the first calculation.
</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_Section_Repeat" data-uid="C1.Report.Section.Repeat">
          <a class="xref" href="C1.Report.Section.Repeat.html#C1_Report_Section_Repeat">Repeat</a>
        </td>
        <td class="markdown level1 summary"><p>For group header, group footer and report footer sections only,
gets or sets a value indicating whether the current section should be repeated
at the top or bottom of each page. The default is <b>false</b>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_Section_SplitBehavior" data-uid="C1.Report.Section.SplitBehavior">
          <a class="xref" href="C1.Report.Section.SplitBehavior.html#C1_Report_Section_SplitBehavior">SplitBehavior</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value determining how the section behaves
when it is too high to fit in the vertical space available on the current page.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_Section_SubSections" data-uid="C1.Report.Section.SubSections">
          <a class="xref" href="C1.Report.Section.SubSections.html#C1_Report_Section_SubSections">SubSections</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the collection of sub-sections in the current section.
This collection contains at least one element.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_Section_Type" data-uid="C1.Report.Section.Type">
          <a class="xref" href="C1.Report.Section.Type.html#C1_Report_Section_Type">Type</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the <a class="xref" href="C1.Report.Section.html">Section</a> type (e.g., PageHeader, Detail).</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_Section_UseColumnLayout" data-uid="C1.Report.Section.UseColumnLayout">
          <a class="xref" href="C1.Report.Section.UseColumnLayout.html#C1_Report_Section_UseColumnLayout">UseColumnLayout</a>
        </td>
        <td class="markdown level1 summary"><p>For master report's group and detail sections only, gets or sets a value
indicating whether the current section should use column layout defined
by <a class="xref" href="C1.Report.Layout.Columns.html#C1_Report_Layout_Columns">Columns</a> and <a class="xref" href="C1.Report.Layout.ColumnLayout.html#C1_Report_Layout_ColumnLayout">ColumnLayout</a> properties.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_Section_Visible" data-uid="C1.Report.Section.Visible">
          <a class="xref" href="C1.Report.Section.Visible.html#C1_Report_Section_Visible">Visible</a>
        </td>
        <td class="markdown level1 summary"><p>Specifies whether the <a class="xref" href="C1.Report.Section.html">Section</a> will be rendered in the report.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Report_Section_AfterRender" data-uid="C1.Report.Section.AfterRender">
          <a class="xref" href="C1.Report.Section.AfterRender.html#C1_Report_Section_AfterRender">AfterRender()</a>
        </td>
        <td class="markdown level1 summary"><p>Called when report rendering finished.
Can be used to finalize object after rendering.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_Section_AssignFrom_C1_Report_ReportObject_System_Boolean_" data-uid="C1.Report.Section.AssignFrom(C1.Report.ReportObject,System.Boolean)">
          <a class="xref" href="C1.Report.Section.AssignFrom.html#C1_Report_Section_AssignFrom_C1_Report_ReportObject_System_Boolean_">AssignFrom(ReportObject, bool)</a>
        </td>
        <td class="markdown level1 summary"><p>Assigns (copies) properties from another <a class="xref" href="C1.Report.Section.html">Section</a> to the current object.
This method copies list of subsections but does not copy list of fields.
This method does NOT copy type of the section.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_Section_BeforeRender" data-uid="C1.Report.Section.BeforeRender">
          <a class="xref" href="C1.Report.Section.BeforeRender.html#C1_Report_Section_BeforeRender">BeforeRender()</a>
        </td>
        <td class="markdown level1 summary"><p>Called where report rendering starts.
Can be used to initialize object before rendering.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_Section_CalculateSize" data-uid="C1.Report.Section.CalculateSize">
          <a class="xref" href="C1.Report.Section.CalculateSize.html#C1_Report_Section_CalculateSize">CalculateSize()</a>
        </td>
        <td class="markdown level1 summary"><p>Calculates section's size.
Note! This method does not execute <a class="xref" href="C1.Report.Section.OnFormat.html#C1_Report_Section_OnFormat">OnFormat</a> script and
does not fire <a class="xref" href="C1.Report.FlexReport.StartSection.html">StartSection</a> event and intended
to be used from VB scripts to update <a class="xref" href="C1.Report.Section.RenderHeight.html#C1_Report_Section_RenderHeight">RenderHeight</a> property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_Section_CreateSame" data-uid="C1.Report.Section.CreateSame">
          <a class="xref" href="C1.Report.Section.CreateSame.html#C1_Report_Section_CreateSame">CreateSame()</a>
        </td>
        <td class="markdown level1 summary"><p>Creates instance of the same type as current object.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_Section_GetPropsTable" data-uid="C1.Report.Section.GetPropsTable">
          <a class="xref" href="C1.Report.Section.GetPropsTable.html#C1_Report_Section_GetPropsTable">GetPropsTable()</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
      <tr>
        <td id="C1_Report_Section_Import_C1_Document_Serialization_XmlNodeWrapperBase_" data-uid="C1.Report.Section.Import(C1.Document.Serialization.XmlNodeWrapperBase)">
          <a class="xref" href="C1.Report.Section.Import.html#C1_Report_Section_Import_C1_Document_Serialization_XmlNodeWrapperBase_">Import(XmlNodeWrapperBase)</a>
        </td>
        <td class="markdown level1 summary"><p>Imports node from legacy xml report definition;</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
