# GrapeCity.ActiveReports.Viewer.Wpf.Viewer.Export

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_ActiveReports_Viewer_Wpf_Viewer_Export_" data-uid="GrapeCity.ActiveReports.Viewer.Wpf.Viewer.Export*">Export Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_ActiveReports_Viewer_Wpf_Viewer_Export_" data-uid="GrapeCity.ActiveReports.Viewer.Wpf.Viewer.Export*"></a>
<h4 id="GrapeCity_ActiveReports_Viewer_Wpf_Viewer_Export_GrapeCity_ActiveReports_Export_IDocumentExport_System_IO_FileInfo_" data-uid="GrapeCity.ActiveReports.Viewer.Wpf.Viewer.Export(GrapeCity.ActiveReports.Export.IDocumentExport,System.IO.FileInfo)">Export(IDocumentExport, FileInfo)</h4>
<div class="markdown level1 summary"><p>Exports the specified page range of the currently loaded report to the specified file by using the specified export filter.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Export(IDocumentExport filter, FileInfo file)</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="../MESCIUS.ActiveReports/GrapeCity.ActiveReports.Export.IDocumentExport.html">IDocumentExport</a></td>
      <td><span class="parametername">filter</span></td>
      <td><p>The export filter to use.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.fileinfo">FileInfo</a></td>
      <td><span class="parametername">file</span></td>
      <td><p>The file to export to.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_Viewer_Wpf_Viewer_Export_GrapeCity_ActiveReports_Export_IDocumentExport_System_IO_FileInfo__examples">Examples</h5>
<p>An example of export report to pdf file:</p>
<pre><code class="lang-csharp">var pdfExport = new PdfExport();
var exportFile = new FileInfo("path/to/your/report.pdf");
viewer.Export(pdfExport, exportFile);</code></pre>



<a id="GrapeCity_ActiveReports_Viewer_Wpf_Viewer_Export_" data-uid="GrapeCity.ActiveReports.Viewer.Wpf.Viewer.Export*"></a>
<h4 id="GrapeCity_ActiveReports_Viewer_Wpf_Viewer_Export_GrapeCity_ActiveReports_Export_IDocumentExport_System_IO_FileInfo_System_String_" data-uid="GrapeCity.ActiveReports.Viewer.Wpf.Viewer.Export(GrapeCity.ActiveReports.Export.IDocumentExport,System.IO.FileInfo,System.String)">Export(IDocumentExport, FileInfo, string)</h4>
<div class="markdown level1 summary"><p>Exports the specified page range of the currently loaded report to the specified file by using the specified export filter.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Export(IDocumentExport filter, FileInfo file, string pageRange)</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="../MESCIUS.ActiveReports/GrapeCity.ActiveReports.Export.IDocumentExport.html">IDocumentExport</a></td>
      <td><span class="parametername">filter</span></td>
      <td><p>The export filter to use.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.fileinfo">FileInfo</a></td>
      <td><span class="parametername">file</span></td>
      <td><p>The file to export to.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">pageRange</span></td>
      <td><p>The page range to export. The format of the range is a comma-separated list of page numbers &quot;2,5,7&quot;
or page ranges &quot;3-5&quot;. If an empty string is provided, the entire report is exported.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_Viewer_Wpf_Viewer_Export_GrapeCity_ActiveReports_Export_IDocumentExport_System_IO_FileInfo_System_String__examples">Examples</h5>
<p>An example of export report to pdf file:</p>
<pre><code class="lang-csharp">var pdfExport = new PdfExport();
var exportFile = new FileInfo("path/to/your/report.pdf");
viewer.Export(pdfExport, exportFile, "1,3,5");</code></pre>



<a id="GrapeCity_ActiveReports_Viewer_Wpf_Viewer_Export_" data-uid="GrapeCity.ActiveReports.Viewer.Wpf.Viewer.Export*"></a>
<h4 id="GrapeCity_ActiveReports_Viewer_Wpf_Viewer_Export_GrapeCity_ActiveReports_Export_IDocumentExport_System_IO_Stream_" data-uid="GrapeCity.ActiveReports.Viewer.Wpf.Viewer.Export(GrapeCity.ActiveReports.Export.IDocumentExport,System.IO.Stream)">Export(IDocumentExport, Stream)</h4>
<div class="markdown level1 summary"><p>Exports the specified page range of the currently loaded report to the specified stream by using the specified export filter.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Export(IDocumentExport filter, Stream stream)</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="../MESCIUS.ActiveReports/GrapeCity.ActiveReports.Export.IDocumentExport.html">IDocumentExport</a></td>
      <td><span class="parametername">filter</span></td>
      <td><p>The export filter to use.</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>The stream to export to.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_Viewer_Wpf_Viewer_Export_GrapeCity_ActiveReports_Export_IDocumentExport_System_IO_Stream__examples">Examples</h5>
<p>An example of export report to pdf file:</p>
<pre><code class="lang-csharp">using (var stream = new MemoryStream())
{
	var pdfExport = new PdfExport();
	viewer.Export(pdfExport, stream);
	// Use the stream containing the exported report
}</code></pre>



<a id="GrapeCity_ActiveReports_Viewer_Wpf_Viewer_Export_" data-uid="GrapeCity.ActiveReports.Viewer.Wpf.Viewer.Export*"></a>
<h4 id="GrapeCity_ActiveReports_Viewer_Wpf_Viewer_Export_GrapeCity_ActiveReports_Export_IDocumentExport_System_IO_Stream_System_String_" data-uid="GrapeCity.ActiveReports.Viewer.Wpf.Viewer.Export(GrapeCity.ActiveReports.Export.IDocumentExport,System.IO.Stream,System.String)">Export(IDocumentExport, Stream, string)</h4>
<div class="markdown level1 summary"><p>Exports the specified page range of the currently loaded report to the specified stream by using the specified export filter.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Export(IDocumentExport filter, Stream stream, string pageRange)</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="../MESCIUS.ActiveReports/GrapeCity.ActiveReports.Export.IDocumentExport.html">IDocumentExport</a></td>
      <td><span class="parametername">filter</span></td>
      <td><p>The export filter to use.</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>The stream to export to.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">pageRange</span></td>
      <td><p>The page range to export. The format of the range is a comma-separated list of page numbers &quot;2,5,7&quot;
or page ranges &quot;3-5&quot;. If an empty string is provided, the entire report is exported.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_Viewer_Wpf_Viewer_Export_GrapeCity_ActiveReports_Export_IDocumentExport_System_IO_Stream_System_String__examples">Examples</h5>
<p>An example of export report to pdf file:</p>
<pre><code class="lang-csharp">using (var memoryStream = new MemoryStream())
{
	var pdfExport = new PdfExport();
	viewer.Export(pdfExport, memoryStream, "1,5");
	// The memoryStream contains the first and the fifth pages of the report exported as a PDF.
}</code></pre>

</div>
