# C1.Report.Section.OnFormat

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Report_Section_OnFormat_" data-uid="C1.Report.Section.OnFormat*">OnFormat Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Report_Section_OnFormat_" data-uid="C1.Report.Section.OnFormat*"></a>
<h4 id="C1_Report_Section_OnFormat" data-uid="C1.Report.Section.OnFormat">OnFormat</h4>
<div 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>
</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;Section.OnFormat&quot;, &quot;The VBScript code executed before the section is formatted.&quot;)]
public string OnFormat { get; set; }</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">&lt;C1Category(&quot;Script&quot;)&gt;
&lt;C1Description(&quot;Section.OnFormat&quot;, &quot;The VBScript code executed before the section is formatted.&quot;)&gt;
Public Property OnFormat As String</code></pre>
</div>
<h5 id="C1_Report_Section_OnFormat_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This property contains <b>VBScript</b> instructions to be executed before the fields in the section 
are calculated. When this script is executed, the recordset already holds the data that will be displayed 
in the section, but the field values have not been updated yet.</p>
<p>Use this event to assign values to fields before they are calculated, so the new values will be taken 
into account when the control calculates the field's size and position when the <a class="xref" href="C1.Report.Section.CanGrow.html#C1_Report_Section_CanGrow">CanGrow</a> or 
<a class="xref" href="C1.Report.Section.CanShrink.html#C1_Report_Section_CanShrink">CanShrink</a> properties are set to true.</p>
<p>If you want to set field properties based on the field's current value, use the <a class="xref" href="C1.Report.Section.OnPrint.html#C1_Report_Section_OnPrint">OnPrint</a> 
property instead.</p>
</div>
</div>
