# GrapeCity.ActiveReports.SectionReport.ResourceLocator

## Content

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



<h1 id="GrapeCity_ActiveReports_SectionReport_ResourceLocator_" data-uid="GrapeCity.ActiveReports.SectionReport.ResourceLocator*">ResourceLocator Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_ActiveReports_SectionReport_ResourceLocator_" data-uid="GrapeCity.ActiveReports.SectionReport.ResourceLocator*"></a>
<h4 id="GrapeCity_ActiveReports_SectionReport_ResourceLocator" data-uid="GrapeCity.ActiveReports.SectionReport.ResourceLocator">ResourceLocator</h4>
<div class="markdown level1 summary"><p>Gets or sets a value representing the implementation of the resource locator.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">[Browsable(false)]
public ResourceLocator ResourceLocator { get; set; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</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="../MESCIUS.ActiveReports.Core.Rdl/GrapeCity.ActiveReports.ResourceLocator.html">ResourceLocator</a></td>
      <td><p>A <a class="xref" href="GrapeCity.ActiveReports.SectionReport.ResourceLocator.html#GrapeCity_ActiveReports_SectionReport_ResourceLocator">ResourceLocator</a> object.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_SectionReport_ResourceLocator_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>The default value is an instance of a <a class="xref" href="../MESCIUS.ActiveReports.Core.Rdl/GrapeCity.ActiveReports.DefaultResourceLocator.html">DefaultResourceLocator</a>.</p>
</div>
<h5 id="GrapeCity_ActiveReports_SectionReport_ResourceLocator_examples">Examples</h5>
<p>Resource locator implementation</p>
<pre><code class="lang-csharp">internal sealed class MyPicturesLocator : GrapeCity.ActiveReports.ResourceLocator
{
	private const string UriSchemeMyImages = "MyPictures:";
	public override Resource GetResource(ResourceInfo resourceInfo)
	{
		Resource resource;
		Uri uri = new Uri(resourceInfo.Name);
		string picturePath = GetPath(resourceInfo.Name);
		MemoryStream stream = new MemoryStream();
		using (FileStream source = File.Open(picturePath, FileMode.Open))
		{
			source.CopyTo(stream);
		}
		stream.Position = 0;
		return new Resource(stream, uri);
	}

	private string GetPath(string resourceName)
	{
		string name = resourceName.Substring(UriSchemeMyImages.Length);
		string myPicturesPath = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
		return Path.Combine(myPicturesPath, name);
	}
}</code></pre>
<p>Resource locator assigning</p>
<pre><code class="lang-csharp">var sectionReport = new GrapeCity.ActiveReports.SectionReport();
sectionReport.ResourceLocator = new MyPicturesLocator();
var xtr = new System.Xml.XmlTextReader(filePath);
sectionReport.LoadLayout(xtr);
sectionReport.Document.Printer.PrinterName = String.Empty;
sectionReport.Run();</code></pre>

</div>
