# GrapeCity.ActiveReports.Document.PageDocument.LocateDataSource

## Content

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




<h1 id="GrapeCity_ActiveReports_Document_PageDocument_LocateDataSource" data-uid="GrapeCity.ActiveReports.Document.PageDocument.LocateDataSource" class="text-break">LocateDataSource Event
</h1>
<div class="markdown level0 summary"><p>Occurs when the report needs to locate a data source from the calling application.</p>
</div>
<div class="markdown level0 conceptual"></div>
<h6><strong>Namespace</strong>: <a class="xref" href="GrapeCity.ActiveReports.Document.html">GrapeCity.ActiveReports.Document</a></h6>
<h6><strong>Assembly</strong>: MESCIUS.ActiveReports.dll</h6>
<h5 id="GrapeCity_ActiveReports_Document_PageDocument_LocateDataSource_syntax">Syntax</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public event LocateDataSourceEventHandler LocateDataSource</code></pre>
</div>
<h5 class="returns">Returns</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="GrapeCity.ActiveReports.LocateDataSourceEventHandler.html">LocateDataSourceEventHandler</a></td>
      <td>Occurs when the report needs to locate a data source from the calling application.</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_Document_PageDocument_LocateDataSource_examples"><strong>Examples</strong></h5>
<pre><code class="lang-csharp">PageReport pageReport = new PageReport(reportFilePath);
pageReport.Document.LocateDataSource  += (sender, args) =&gt;
{
	if (args.DataSet.Name == "Catalog")
	{
		DataSet ds = new DataSet();
		ds.ReadXml("XML_Schema_and_Data.xml");
		args.Data = ds.Tables[0];
	}
};
reportPreview.LoadDocument(pageReport.Document);</code></pre>

</div>
