# GrapeCity.ActiveReports.Chart.Exchange.Persistence.FromXml

## Content

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



<h1 id="GrapeCity_ActiveReports_Chart_Exchange_Persistence_FromXml_" data-uid="GrapeCity.ActiveReports.Chart.Exchange.Persistence.FromXml*">FromXml Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_ActiveReports_Chart_Exchange_Persistence_FromXml_" data-uid="GrapeCity.ActiveReports.Chart.Exchange.Persistence.FromXml*"></a>
<h4 id="GrapeCity_ActiveReports_Chart_Exchange_Persistence_FromXml_GrapeCity_ActiveReports_Chart_ISharpGraph_System_Xml_XmlElement_" data-uid="GrapeCity.ActiveReports.Chart.Exchange.Persistence.FromXml(GrapeCity.ActiveReports.Chart.ISharpGraph,System.Xml.XmlElement)">FromXml(ISharpGraph, XmlElement)</h4>
<div class="markdown level1 summary"><p>Reconstructs a SharpGraph object with a specified state from an XML encoding.</p>
<p>Use &quot;strict&quot; attribute of root element &quot;SharpGraph&quot; in xml files
to control error handling behaviour. This attribute is false by default. If true xml import process will stop once it finds first error and throw an exception.
If false it will mutually continue.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static void FromXml(ISharpGraph sharpChartControl, XmlElement rootElement)</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="GrapeCity.ActiveReports.Chart.ISharpGraph.html">ISharpGraph</a></td>
      <td><span class="parametername">sharpChartControl</span></td>
      <td></td>
    </tr>
    <tr>
      <td><span class="xref">XmlElement</span></td>
      <td><span class="parametername">rootElement</span></td>
      <td><p>The XML encoding to use to reconstruct the SharpGraph object.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_ActiveReports_Chart_Exchange_Persistence_FromXml_" data-uid="GrapeCity.ActiveReports.Chart.Exchange.Persistence.FromXml*"></a>
<h4 id="GrapeCity_ActiveReports_Chart_Exchange_Persistence_FromXml_GrapeCity_ActiveReports_Chart_ISharpGraph_System_Xml_XmlElement_System_Boolean_" data-uid="GrapeCity.ActiveReports.Chart.Exchange.Persistence.FromXml(GrapeCity.ActiveReports.Chart.ISharpGraph,System.Xml.XmlElement,System.Boolean)">FromXml(ISharpGraph, XmlElement, bool)</h4>
<div class="markdown level1 summary"><p>Reconstructs a chart from its XML representation, populating the supplied control. Use the
<code class="paramref">includeData</code> flag to control whether bound data is restored along with the layout.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static void FromXml(ISharpGraph sharpChartControl, XmlElement rootElement, bool includeData)</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="GrapeCity.ActiveReports.Chart.ISharpGraph.html">ISharpGraph</a></td>
      <td><span class="parametername">sharpChartControl</span></td>
      <td><p>The chart control to populate from the XML.</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">XmlElement</span></td>
      <td><span class="parametername">rootElement</span></td>
      <td><p>The root XML element previously produced when the chart was serialized.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">includeData</span></td>
      <td><p><a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a> to also restore data-related content; <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">false</a> to restore only the chart definition.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_Chart_Exchange_Persistence_FromXml_GrapeCity_ActiveReports_Chart_ISharpGraph_System_Xml_XmlElement_System_Boolean__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>If the root element carries a <code>strict</code> attribute set to <code>true</code>, deserialization failures are
rethrown; otherwise individual property failures are ignored and import continues.</p>
</div>


<a id="GrapeCity_ActiveReports_Chart_Exchange_Persistence_FromXml_" data-uid="GrapeCity.ActiveReports.Chart.Exchange.Persistence.FromXml*"></a>
<h4 id="GrapeCity_ActiveReports_Chart_Exchange_Persistence_FromXml_GrapeCity_ActiveReports_Chart_ISharpGraph_System_String_" data-uid="GrapeCity.ActiveReports.Chart.Exchange.Persistence.FromXml(GrapeCity.ActiveReports.Chart.ISharpGraph,System.String)">FromXml(ISharpGraph, string)</h4>
<div class="markdown level1 summary"><p>Reconstructs a SharpGraph object with a specified state from an XML encoding.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static void FromXml(ISharpGraph sharpChartControl, string fileName)</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="GrapeCity.ActiveReports.Chart.ISharpGraph.html">ISharpGraph</a></td>
      <td><span class="parametername">sharpChartControl</span></td>
      <td></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>The XML file name to use to reconstruct the SharpGraph object.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_ActiveReports_Chart_Exchange_Persistence_FromXml_" data-uid="GrapeCity.ActiveReports.Chart.Exchange.Persistence.FromXml*"></a>
<h4 id="GrapeCity_ActiveReports_Chart_Exchange_Persistence_FromXml_GrapeCity_ActiveReports_Chart_ISharpGraph_System_String_System_Boolean_" data-uid="GrapeCity.ActiveReports.Chart.Exchange.Persistence.FromXml(GrapeCity.ActiveReports.Chart.ISharpGraph,System.String,System.Boolean)">FromXml(ISharpGraph, string, bool)</h4>
<div class="markdown level1 summary"><p>Reconstructs a chart from an XML file, populating the supplied control. Use the
<code class="paramref">includeData</code> flag to control whether bound data is restored along with the layout.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static void FromXml(ISharpGraph sharpChartControl, string fileName, bool includeData)</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="GrapeCity.ActiveReports.Chart.ISharpGraph.html">ISharpGraph</a></td>
      <td><span class="parametername">sharpChartControl</span></td>
      <td><p>The chart control to populate from the file.</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>The path of the XML file previously produced when the chart was serialized.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">includeData</span></td>
      <td><p><a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">true</a> to also restore data-related content; <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool">false</a> to restore only the chart definition.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
