# GrapeCity.ActiveReports.Viewer.Win.Viewer.Export

## Content

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



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



<a id="GrapeCity_ActiveReports_Viewer_Win_Viewer_Export_" data-uid="GrapeCity.ActiveReports.Viewer.Win.Viewer.Export*"></a>
<h4 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_Export_GrapeCity_ActiveReports_Export_IDocumentExport_System_IO_FileInfo_" data-uid="GrapeCity.ActiveReports.Viewer.Win.Viewer.Export(GrapeCity.ActiveReports.Export.IDocumentExport,System.IO.FileInfo)">Export(IDocumentExport, FileInfo)</h4>
<div class="markdown level1 summary"><p>Exports the currently loaded report to the specified file using the given 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>An object that implements <a class="xref" href="../MESCIUS.ActiveReports/GrapeCity.ActiveReports.Export.IDocumentExport.html">IDocumentExport</a> interface, providing export functionality.</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 <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.fileinfo">FileInfo</a> object representing the file to which the report will be exported. The file extension should match
the format specified by the <code class="paramref">filter</code>.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_Export_GrapeCity_ActiveReports_Export_IDocumentExport_System_IO_FileInfo__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This method exports the entire report. The export process is determined by the capabilities of the specified <code class="paramref">filter</code>,
which includes handling various export formats and their respective options.</p>
</div>
<h5 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_Export_GrapeCity_ActiveReports_Export_IDocumentExport_System_IO_FileInfo__examples">Examples</h5>
<pre><code class="lang-csharp">// Assuming 'viewer' is your Viewer control instance
var pdfExport = new PdfExport();
var exportFilePath = new FileInfo("path/to/your/exportedFile.pdf");
viewer.Export(pdfExport, exportFilePath);</code></pre>

<h5 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_Export_GrapeCity_ActiveReports_Export_IDocumentExport_System_IO_FileInfo__seealso">See Also</h5>
<div class="seealso">
    <div><a class="xref" href="../MESCIUS.ActiveReports/GrapeCity.ActiveReports.Export.IDocumentExport.html">IDocumentExport</a></div>
</div>


<a id="GrapeCity_ActiveReports_Viewer_Win_Viewer_Export_" data-uid="GrapeCity.ActiveReports.Viewer.Win.Viewer.Export*"></a>
<h4 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_Export_GrapeCity_ActiveReports_Export_IDocumentExport_System_IO_FileInfo_System_String_" data-uid="GrapeCity.ActiveReports.Viewer.Win.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 using the given 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>An object that implements <a class="xref" href="../MESCIUS.ActiveReports/GrapeCity.ActiveReports.Export.IDocumentExport.html">IDocumentExport</a> interface, providing export functionality.</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 <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.fileinfo">FileInfo</a> object representing the file to which the report will be exported.</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>A string specifying the range of pages to be exported. The format of the range is a comma-separated list of page numbers
or page ranges. If an empty string is provided, the entire report is exported.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_Export_GrapeCity_ActiveReports_Export_IDocumentExport_System_IO_FileInfo_System_String__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This method allows for selective export of pages, which can be useful when dealing with large reports or when
only a specific section of a report is needed in the exported document.</p>
</div>
<h5 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_Export_GrapeCity_ActiveReports_Export_IDocumentExport_System_IO_FileInfo_System_String__examples">Examples</h5>
<p>Here is an example of using an export current report to pdf file:</p>
<pre><code class="lang-csharp">var pdfExport = new PdfExport();
var exportFile = new FileInfo("report.pdf");
viewer.Export(pdfExport, exportFile, "1,3,5");</code></pre>



<a id="GrapeCity_ActiveReports_Viewer_Win_Viewer_Export_" data-uid="GrapeCity.ActiveReports.Viewer.Win.Viewer.Export*"></a>
<h4 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_Export_GrapeCity_ActiveReports_Export_IDocumentExport_System_IO_Stream_" data-uid="GrapeCity.ActiveReports.Viewer.Win.Viewer.Export(GrapeCity.ActiveReports.Export.IDocumentExport,System.IO.Stream)">Export(IDocumentExport, Stream)</h4>
<div class="markdown level1 summary"><p>Exports the currently loaded report to the specified stream using the given 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>An object that implements <a class="xref" href="../MESCIUS.ActiveReports/GrapeCity.ActiveReports.Export.IDocumentExport.html">IDocumentExport</a> interface, providing export functionality.</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 <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a> to which the report will be exported. The stream must be writable.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_Export_GrapeCity_ActiveReports_Export_IDocumentExport_System_IO_Stream__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This method exports the entire report unless a specific page range is set in subsequent calls or configurations.
The export process is determined by the capabilities of the specified <code class="paramref">filter</code>, which includes handling various export formats
and their respective options.</p>
</div>
<h5 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_Export_GrapeCity_ActiveReports_Export_IDocumentExport_System_IO_Stream__examples">Examples</h5>
<p>Here is 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_Win_Viewer_Export_" data-uid="GrapeCity.ActiveReports.Viewer.Win.Viewer.Export*"></a>
<h4 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_Export_GrapeCity_ActiveReports_Export_IDocumentExport_System_IO_Stream_System_String_" data-uid="GrapeCity.ActiveReports.Viewer.Win.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 using the given 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>An object that implements <a class="xref" href="../MESCIUS.ActiveReports/GrapeCity.ActiveReports.Export.IDocumentExport.html">IDocumentExport</a> interface, providing export functionality.</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 <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a> to which the report will be exported. The stream must be writable.</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>A string specifying the range of pages to be exported. The format of the range is a comma-separated list of page numbers
or page ranges. If an empty string is provided, the entire report is exported.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_Export_GrapeCity_ActiveReports_Export_IDocumentExport_System_IO_Stream_System_String__examples">Examples</h5>
<p>Here is an example of export report to pdf file:</p>
<pre><code class="lang-csharp">using (var memoryStream = new MemoryStream())
{
	var pdfExportFilter = new PdfExport();
	viewer.Export(pdfExportFilter, memoryStream, "1,5");
	// The memoryStream now contains the first and the fifth pages of the report exported as a PDF.
}</code></pre>

</div>
