# GrapeCity.ActiveReports.SectionReport.LocateCredentials

## Content

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




<h1 id="GrapeCity_ActiveReports_SectionReport_LocateCredentials" data-uid="GrapeCity.ActiveReports.SectionReport.LocateCredentials" class="text-break">LocateCredentials Event
</h1>
<div class="markdown level0 summary"><p>Occurs when the report needs to obtain data source credentials from the calling application.</p>
</div>
<div class="markdown level0 conceptual"></div>
<h6><strong>Namespace</strong>: <a class="xref" href="GrapeCity.ActiveReports.html">GrapeCity.ActiveReports</a></h6>
<h6><strong>Assembly</strong>: MESCIUS.ActiveReports.dll</h6>
<h5 id="GrapeCity_ActiveReports_SectionReport_LocateCredentials_syntax">Syntax</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public event LocateCredentialsEventHandler LocateCredentials</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="../MESCIUS.ActiveReports.Chart/GrapeCity.ActiveReports.Chart.Designer.LocateCredentialsEventHandler.html">LocateCredentialsEventHandler</a></td>
      <td>Occurs when the report needs to obtain data source credentials from the calling application.</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_SectionReport_LocateCredentials_examples"><strong>Examples</strong></h5>
<pre><code class="lang-csharp">var sectionReport = new GrapeCity.ActiveReports.SectionReport();
sectionReport.LoadLayout(reportFilePath);
sectionReport.Document.Printer.PrinterName = String.Empty;
sectionReport.LocateCredentials += (s, args) =&gt;
{
	if (args.Name == "MyDB")
	{
		args.UserName = "guest";
		args.Password = "12345";
	}
};</code></pre>

</div>
