# C1.WPF.Grid.Extensions.SaveAsync

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_WPF_Grid_Extensions_SaveAsync_" data-uid="C1.WPF.Grid.Extensions.SaveAsync*">SaveAsync Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_WPF_Grid_Extensions_SaveAsync_" data-uid="C1.WPF.Grid.Extensions.SaveAsync*"></a>
<h4 id="C1_WPF_Grid_Extensions_SaveAsync_C1_WPF_Grid_FlexGrid_System_String_System_String_GrapeCity_Documents_Excel_SaveFileFormat_C1_WPF_Grid_GridRowColRanges_C1_WPF_Grid_GridRowColRanges_C1_WPF_Grid_GridHeadersVisibility_System_Boolean_System_Boolean_System_Boolean_System_Drawing_Printing_PrinterSettings_" data-uid="C1.WPF.Grid.Extensions.SaveAsync(C1.WPF.Grid.FlexGrid,System.String,System.String,GrapeCity.Documents.Excel.SaveFileFormat,C1.WPF.Grid.GridRowColRanges,C1.WPF.Grid.GridRowColRanges,C1.WPF.Grid.GridHeadersVisibility,System.Boolean,System.Boolean,System.Boolean,System.Drawing.Printing.PrinterSettings)">SaveAsync(FlexGrid, string, string, SaveFileFormat, GridRowColRanges, GridRowColRanges, GridHeadersVisibility, bool, bool, bool, PrinterSettings)</h4>
<div class="markdown level1 summary"><p>Saves the contents of the grid in a desired format using GcExcel</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Task SaveAsync(this FlexGrid grid, string fileName, string sheetName, SaveFileFormat saveFileFormat, GridRowColRanges rows = null, GridRowColRanges columns = null, GridHeadersVisibility headers = GridHeadersVisibility.None, bool merged = false, bool formatted = false, bool renderImages = false, PrinterSettings printerSettings = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function SaveAsync(grid As FlexGrid, fileName As String, sheetName As String, saveFileFormat As SaveFileFormat, Optional rows As GridRowColRanges = Nothing, Optional columns As GridRowColRanges = Nothing, Optional headers As GridHeadersVisibility = GridHeadersVisibility.None, Optional merged As Boolean = False, Optional formatted As Boolean = False, Optional renderImages As Boolean = False, Optional printerSettings As PrinterSettings = Nothing) As Task</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="../C1.WPF.Grid/C1.WPF.Grid.FlexGrid.html">FlexGrid</a></td>
      <td><span class="parametername">grid</span></td>
      <td><p>The grid this method will be used as an extension towards.</p>
</td>
    </tr>
    <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 String representing the name of the file to save.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">sheetName</span></td>
      <td><p>A String representing the worksheet name.</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">SaveFileFormat</span></td>
      <td><span class="parametername">saveFileFormat</span></td>
      <td><p><span class="xref">GrapeCity.Documents.Excel.SaveFileFormat</span>A SaveFileFormat enum value that specifies the format the file should be saved into.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.WPF.Grid.GridRowColRanges.html">GridRowColRanges</a></td>
      <td><span class="parametername">rows</span></td>
      <td><p>A GridRowColRanges object representing the row settings to be taken into consideration whilst exporting.
<remarks>Could contain specific ranges and/or other flagged options.</remarks></p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.WPF.Grid.GridRowColRanges.html">GridRowColRanges</a></td>
      <td><span class="parametername">columns</span></td>
      <td><p>A GridRowColRanges object representing the column settings to be taken into consideration whilst exporting.
<remarks>Could contain specific ranges and/or other flagged options.</remarks></p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="../C1.WPF.Grid/C1.WPF.Grid.GridHeadersVisibility.html">GridHeadersVisibility</a></td>
      <td><span class="parametername">headers</span></td>
      <td><p>A GridHeadersVisibility enum value that represents the header visibility options to be taken in consideration whilst exporting.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">merged</span></td>
      <td><p>A Boolean flag denoting whether to render merged ranges in the output.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">formatted</span></td>
      <td><p>A Boolean flag denoting whether to render cell values as formatted in the output.
<remarks>If a grid column has a data map and this flag is not true, the rendered output will render the original values.</remarks></p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">renderImages</span></td>
      <td><p>A Boolean flag denoting whether to render images in the output.
<remarks>If this value is false, their URI's are used instead.</remarks></p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.printing.printersettings">PrinterSettings</a></td>
      <td><span class="parametername">printerSettings</span></td>
      <td><p>A PrinterSettings object representing all the printer settings to be passed down to the output.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.threading.tasks.task">Task</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="C1_WPF_Grid_Extensions_SaveAsync_" data-uid="C1.WPF.Grid.Extensions.SaveAsync*"></a>
<h4 id="C1_WPF_Grid_Extensions_SaveAsync_C1_WPF_Grid_FlexGrid_System_IO_Stream_System_String_GrapeCity_Documents_Excel_SaveFileFormat_C1_WPF_Grid_GridRowColRanges_C1_WPF_Grid_GridRowColRanges_C1_WPF_Grid_GridHeadersVisibility_System_Boolean_System_Boolean_System_Boolean_System_Drawing_Printing_PrinterSettings_" data-uid="C1.WPF.Grid.Extensions.SaveAsync(C1.WPF.Grid.FlexGrid,System.IO.Stream,System.String,GrapeCity.Documents.Excel.SaveFileFormat,C1.WPF.Grid.GridRowColRanges,C1.WPF.Grid.GridRowColRanges,C1.WPF.Grid.GridHeadersVisibility,System.Boolean,System.Boolean,System.Boolean,System.Drawing.Printing.PrinterSettings)">SaveAsync(FlexGrid, Stream, string, SaveFileFormat, GridRowColRanges, GridRowColRanges, GridHeadersVisibility, bool, bool, bool, PrinterSettings)</h4>
<div class="markdown level1 summary"><p>Saves the contents of the grid in a desired format using GcExcel</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Task SaveAsync(this FlexGrid grid, Stream stream, string sheetName, SaveFileFormat saveFileFormat, GridRowColRanges rows = null, GridRowColRanges columns = null, GridHeadersVisibility headers = GridHeadersVisibility.None, bool merged = false, bool formatted = false, bool renderImages = false, PrinterSettings printerSettings = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function SaveAsync(grid As FlexGrid, stream As Stream, sheetName As String, saveFileFormat As SaveFileFormat, Optional rows As GridRowColRanges = Nothing, Optional columns As GridRowColRanges = Nothing, Optional headers As GridHeadersVisibility = GridHeadersVisibility.None, Optional merged As Boolean = False, Optional formatted As Boolean = False, Optional renderImages As Boolean = False, Optional printerSettings As PrinterSettings = Nothing) As Task</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="../C1.WPF.Grid/C1.WPF.Grid.FlexGrid.html">FlexGrid</a></td>
      <td><span class="parametername">grid</span></td>
      <td><p>The grid this method will be used as an extension towards.</p>
</td>
    </tr>
    <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 Stream for the output to be written into.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">sheetName</span></td>
      <td><p>A String representing the worksheet name.</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">SaveFileFormat</span></td>
      <td><span class="parametername">saveFileFormat</span></td>
      <td><p><span class="xref">GrapeCity.Documents.Excel.SaveFileFormat</span>A SaveFileFormat enum value that specifies the format the file should be saved into.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.WPF.Grid.GridRowColRanges.html">GridRowColRanges</a></td>
      <td><span class="parametername">rows</span></td>
      <td><p>A GridRowColRanges object representing the row settings to be taken into consideration whilst exporting.
<remarks>Could contain specific ranges and/or other flagged options.</remarks></p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.WPF.Grid.GridRowColRanges.html">GridRowColRanges</a></td>
      <td><span class="parametername">columns</span></td>
      <td><p>A GridRowColRanges object representing the column settings to be taken into consideration whilst exporting.
<remarks>Could contain specific ranges and/or other flagged options.</remarks></p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="../C1.WPF.Grid/C1.WPF.Grid.GridHeadersVisibility.html">GridHeadersVisibility</a></td>
      <td><span class="parametername">headers</span></td>
      <td><p>A GridHeadersVisibility enum value that represents the header visibility options to be taken in consideration whilst exporting.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">merged</span></td>
      <td><p>A Boolean flag denoting whether to render merged ranges in the output.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">formatted</span></td>
      <td><p>A Boolean flag denoting whether to render cell values as formatted in the output.
<remarks>If a grid column has a data map and this flag is not true, the rendered output will render the original values.</remarks></p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">renderImages</span></td>
      <td><p>A Boolean flag denoting whether to render images in the output.
<remarks>If this value is false, their URI's are used instead.</remarks></p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.printing.printersettings">PrinterSettings</a></td>
      <td><span class="parametername">printerSettings</span></td>
      <td><p>A PrinterSettings object representing all the printer settings to be passed down to the output.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.threading.tasks.task">Task</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
