# C1.WPF.Excel.XLPrintSettings.Header

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_WPF_Excel_XLPrintSettings_Header_" data-uid="C1.WPF.Excel.XLPrintSettings.Header*">Header Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_WPF_Excel_XLPrintSettings_Header_" data-uid="C1.WPF.Excel.XLPrintSettings.Header*"></a>
<h4 id="C1_WPF_Excel_XLPrintSettings_Header" data-uid="C1.WPF.Excel.XLPrintSettings.Header">Header</h4>
<div class="markdown level1 summary"><p>Gets or sets the string to be displayed as a page header when the sheet is printed.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public string Header { get; set; }</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Property Header As String</code></pre>
</div>
<h5 id="C1_WPF_Excel_XLPrintSettings_Header_remarks">Remarks</h5>
<div class="markdown level1 remarks"><pre><code>&lt;p&gt;The header string may contain special commands, i.e. placeholders for the page number, 
</code></pre>
<p>current date, or text formatting attributes. Most of these fields are represented by single
letters with a leading ampersand (&quot;&amp;&quot;).</p>
<p>The page header is divided into 3 sections: left, center, and right. Each section is
introduced by a special command (&quot;&amp;L&quot;, &quot;&amp;C&quot;, and &quot;&amp;R&quot;). All text and all commands following
are part of the selected section.</p>
<p>The following commands are available:</p>
<p>&amp;L Start of the left section</p>
<p>&amp;C Start of the centered section</p>
<p>&amp;R Start of the right section</p>
<p>&amp;P Current page number</p>
<p>&amp;N Page count</p>
<p>&amp;D Current date</p>
<p>&amp;T Current time</p>
<p>&amp;A Sheet name</p>
<p>&amp;F File name without path</p>
<p>&amp;Z File path without file name</p>
<p>&amp;G Picture (file name)</p>
<p>&amp;B Bold toggle</p>
<p>&amp;I Italic toggle</p>
<p>&amp;U Underline toggle</p>
<p>&amp;E Double underline toggle</p>
<p>&amp;S Strikeout toggle</p>
<p>&amp;X Superscript toggle</p>
<p>&amp;Y Subscript toggle</p>
<p>&amp;&quot;[FontName]&quot; Set new font</p>
<p>&amp;&quot;[FontName,FontStyle]&quot; Set new font with specified style. The style is in most cases
&quot;Regular&quot;, &quot;Bold&quot;, &quot;Italic&quot;, or &quot;Bold Italic&quot;.</p>
&amp;[fontheight] Set font height in points.
</div>
<h5 id="C1_WPF_Excel_XLPrintSettings_Header_examples">Examples</h5>
<p>The code below creates a header with left, center, and right portions.</p>
<pre><code class="lang-csharp">PrintSettings ps = sheet.PrintSettings;
ps.Header = "&amp;LHeader Left&amp;CHeader Center&amp;RHeader Right";</code></pre>

</div>
