# GrapeCity.Documents.Excel.PivotFieldDateGroupOptions

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="GrapeCity_Documents_Excel_PivotFieldDateGroupOptions" data-uid="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions" class="text-break">PivotFieldDateGroupOptions Class
</h1>
  <div class="markdown level0 summary"><p>Represents the settings used to group a PivotField by date or time units.</p>
<p>
Use this class to configure the date range and the date or time units used by
<a class="xref" href="GrapeCity.Documents.Excel.IPivotField.Group.html#GrapeCity_Documents_Excel_IPivotField_Group_GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_">Group(PivotFieldDateGroupOptions)</a>. By default, the
group range is determined from the PivotCache and the field is grouped by
<a class="xref" href="GrapeCity.Documents.Excel.PivotFieldDateGroupBy.html#GrapeCity_Documents_Excel_PivotFieldDateGroupBy_Months">Months</a>.
</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"><span class="xref">PivotFieldDateGroupOptions</span></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="GrapeCity.Documents.Excel.html">GrapeCity.Documents.Excel</a></h6>
  <h6><strong>Assembly</strong>: DS.Documents.Excel.dll</h6>
  <h5 id="GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class PivotFieldDateGroupOptions</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class PivotFieldDateGroupOptions</code></pre>
  </div>
  <h5 id="GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_examples"><strong>Examples</strong></h5>
  <pre><code class="lang-csharp">PivotFieldDateGroupOptions options = new PivotFieldDateGroupOptions
{
    GroupBy = PivotFieldDateGroupBy.Months | PivotFieldDateGroupBy.Years,
    AutoStart = true,
    AutoEnd = true
};
PivotFieldDateGroupBy groupBy = options.GroupBy;</code></pre>

  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="GrapeCity_Documents_Excel_PivotFieldDateGroupOptions__ctor" data-uid="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions.#ctor">
          <a class="xref" href="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions.-ctor.html#GrapeCity_Documents_Excel_PivotFieldDateGroupOptions__ctor">PivotFieldDateGroupOptions()</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
    </tbody>
  </table>
  <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="GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_AddGeneratedFieldsToLayout" data-uid="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions.AddGeneratedFieldsToLayout">
          <a class="xref" href="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions.AddGeneratedFieldsToLayout.html#GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_AddGeneratedFieldsToLayout">AddGeneratedFieldsToLayout</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets whether generated group fields are automatically added to the PivotTable layout.
The default value is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a>.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_AutoEnd" data-uid="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions.AutoEnd">
          <a class="xref" href="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions.AutoEnd.html#GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_AutoEnd">AutoEnd</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets whether the last date is determined from the PivotCache instead of <a class="xref" href="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions.End.html#GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_End">End</a>.
When this value is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">false</a>, <a class="xref" href="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions.End.html#GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_End">End</a> must be set when grouping is applied.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_AutoStart" data-uid="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions.AutoStart">
          <a class="xref" href="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions.AutoStart.html#GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_AutoStart">AutoStart</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets whether the first date is determined from the PivotCache instead of <a class="xref" href="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions.Start.html#GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_Start">Start</a>.
When this value is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">false</a>, <a class="xref" href="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions.Start.html#GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_Start">Start</a> must be set when grouping is applied.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_Days" data-uid="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions.Days">
          <a class="xref" href="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions.Days.html#GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_Days">Days</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the number of days in each generated group when <a class="xref" href="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions.GroupBy.html#GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_GroupBy">GroupBy</a>
includes <a class="xref" href="GrapeCity.Documents.Excel.PivotFieldDateGroupBy.html#GrapeCity_Documents_Excel_PivotFieldDateGroupBy_Days">Days</a>.</p>
<p>
This value is used when <a class="xref" href="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions.GroupBy.html#GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_GroupBy">GroupBy</a> includes <a class="xref" href="GrapeCity.Documents.Excel.PivotFieldDateGroupBy.html#GrapeCity_Documents_Excel_PivotFieldDateGroupBy_Days">Days</a>.
When grouping is applied, it must be a finite whole number greater than <code>0</code>.
The effective start date must also be earlier than the effective end date.
The default value is <code>1</code>.
</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_End" data-uid="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions.End">
          <a class="xref" href="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions.End.html#GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_End">End</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the last date included in the grouped range.</p>
<p>
When <a class="xref" href="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions.AutoEnd.html#GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_AutoEnd">AutoEnd</a> is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a>, this value is ignored and
the last date is determined from the PivotCache.
</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_GroupBy" data-uid="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions.GroupBy">
          <a class="xref" href="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions.GroupBy.html#GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_GroupBy">GroupBy</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the date and time units used to create the grouped PivotField.</p>
<p>
When multiple units are used, grouping is applied in the standard order
from seconds through years.
At least one unit is required when grouping is applied.
</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_Start" data-uid="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions.Start">
          <a class="xref" href="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions.Start.html#GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_Start">Start</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the first date included in the grouped range.</p>
<p>
When <a class="xref" href="GrapeCity.Documents.Excel.PivotFieldDateGroupOptions.AutoStart.html#GrapeCity_Documents_Excel_PivotFieldDateGroupOptions_AutoStart">AutoStart</a> is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a>, this value is ignored and
the first date is determined from the PivotCache.
</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
