# GrapeCity.ActiveReports.Design.Designer.SaveReport

## Content

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



<h1 id="GrapeCity_ActiveReports_Design_Designer_SaveReport_" data-uid="GrapeCity.ActiveReports.Design.Designer.SaveReport*">SaveReport Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_ActiveReports_Design_Designer_SaveReport_" data-uid="GrapeCity.ActiveReports.Design.Designer.SaveReport*"></a>
<h4 id="GrapeCity_ActiveReports_Design_Designer_SaveReport_System_IO_FileInfo_" data-uid="GrapeCity.ActiveReports.Design.Designer.SaveReport(System.IO.FileInfo)">SaveReport(FileInfo)</h4>
<div class="markdown level1 summary"><p>Saves a report XML layout to the specified file.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void SaveReport(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="https://learn.microsoft.com/dotnet/api/system.io.fileinfo">FileInfo</a></td>
      <td><span class="parametername">file</span></td>
      <td><p>FileInfo object representing the file to save the report to.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_Design_Designer_SaveReport_System_IO_FileInfo__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This method first ensures that any pending changes to the report are committed by flushing the designer loader. It then delegates the save operation
to the implementation layer, which handles the specifics of saving the report to the file system. The file path is obtained from the FileInfo object.</p>
</div>
<h5 id="GrapeCity_ActiveReports_Design_Designer_SaveReport_System_IO_FileInfo__examples">Examples</h5>
<p>The following example demonstrates how to save a report to a file:</p>
<pre><code class="lang-csharp">FileInfo reportFile = new FileInfo("path/to/your/report.rdlx");
designer.SaveReport(reportFile);</code></pre>



<a id="GrapeCity_ActiveReports_Design_Designer_SaveReport_" data-uid="GrapeCity.ActiveReports.Design.Designer.SaveReport*"></a>
<h4 id="GrapeCity_ActiveReports_Design_Designer_SaveReport_System_IO_Stream_" data-uid="GrapeCity.ActiveReports.Design.Designer.SaveReport(System.IO.Stream)">SaveReport(Stream)</h4>
<div class="markdown level1 summary"><p>Saves a report XML layout to the specified stream.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">[Obsolete(&quot;This method has been deprecated. Please use SaveReport(XmlWriter) method instead&quot;)]
public void SaveReport(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="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a></td>
      <td><span class="parametername">stream</span></td>
      <td><p>The stream to save the report to.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_Design_Designer_SaveReport_System_IO_Stream__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This method has been deprecated. Please use <a class="xref" href="GrapeCity.ActiveReports.Design.Designer.SaveReport.html#GrapeCity_ActiveReports_Design_Designer_SaveReport_System_Xml_XmlWriter_">SaveReport(XmlWriter)</a> method instead.</p>
</div>


<a id="GrapeCity_ActiveReports_Design_Designer_SaveReport_" data-uid="GrapeCity.ActiveReports.Design.Designer.SaveReport*"></a>
<h4 id="GrapeCity_ActiveReports_Design_Designer_SaveReport_System_Xml_XmlWriter_" data-uid="GrapeCity.ActiveReports.Design.Designer.SaveReport(System.Xml.XmlWriter)">SaveReport(XmlWriter)</h4>
<div class="markdown level1 summary"><p>Saves a report XML layout to the specified writer.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void SaveReport(XmlWriter writer)</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><span class="xref">XmlWriter</span></td>
      <td><span class="parametername">writer</span></td>
      <td><p>The XmlWriter to save the report to.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_Design_Designer_SaveReport_System_Xml_XmlWriter__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This method allows saving the report's XML layout directly to an XmlWriter, providing flexibility in how and where the report is saved.
It checks for a null XmlWriter to avoid exceptions and delegates the save operation to the implementation layer, which handles the serialization
of the report layout.</p>
</div>
<h5 id="GrapeCity_ActiveReports_Design_Designer_SaveReport_System_Xml_XmlWriter__examples">Examples</h5>
<p>The following example demonstrates how to use an XmlWriter to save a report:</p>
<pre><code class="lang-csharp">using (var stream = new FileStream("path/to/your/report.rdlx", FileMode.Create))
using (var writer = XmlWriter.Create(stream))
{
	designer.SaveReport(writer);
}</code></pre>

</div>
