# GrapeCity.ActiveReports.Web.Viewer.ReportViewerConfiguration.UseReportProvider

## Content

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



<h1 id="GrapeCity_ActiveReports_Web_Viewer_ReportViewerConfiguration_UseReportProvider_" data-uid="GrapeCity.ActiveReports.Web.Viewer.ReportViewerConfiguration.UseReportProvider*">UseReportProvider Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_ActiveReports_Web_Viewer_ReportViewerConfiguration_UseReportProvider_" data-uid="GrapeCity.ActiveReports.Web.Viewer.ReportViewerConfiguration.UseReportProvider*"></a>
<h4 id="GrapeCity_ActiveReports_Web_Viewer_ReportViewerConfiguration_UseReportProvider_GrapeCity_ActiveReports_Web_Viewer_IReportProvider_" data-uid="GrapeCity.ActiveReports.Web.Viewer.ReportViewerConfiguration.UseReportProvider(GrapeCity.ActiveReports.Web.Viewer.IReportProvider)">UseReportProvider(IReportProvider)</h4>
<div class="markdown level1 summary"><p>Uses a custom report store provider.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public ReportViewerConfiguration UseReportProvider(IReportProvider reportProvider)</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.Web.Viewer.IReportProvider.html">IReportProvider</a></td>
      <td><span class="parametername">reportProvider</span></td>
      <td><p>The custom report store provider.</p>
</td>
    </tr>
  </tbody>
</table>
<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.Web.Viewer.ReportViewerConfiguration.html">ReportViewerConfiguration</a></td>
      <td><p>The current <a class="xref" href="GrapeCity.ActiveReports.Web.Viewer.ReportViewerConfiguration.html">ReportViewerConfiguration</a> instance.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_Web_Viewer_ReportViewerConfiguration_UseReportProvider_GrapeCity_ActiveReports_Web_Viewer_IReportProvider__examples">Examples</h5>
<pre><code class="lang-csharp">app.UseReportViewer(config =&gt;
{
	// Your implementation of IReportProvider.
	config.UseReportProvider(reportProvider);
});</code></pre>

<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentnullexception">ArgumentNullException</a></td>
      <td><p>Thrown if <code class="paramref">reportProvider</code> is <code>null</code>.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_ActiveReports_Web_Viewer_ReportViewerConfiguration_UseReportProvider_" data-uid="GrapeCity.ActiveReports.Web.Viewer.ReportViewerConfiguration.UseReportProvider*"></a>
<h4 id="GrapeCity_ActiveReports_Web_Viewer_ReportViewerConfiguration_UseReportProvider_GrapeCity_ActiveReports_Web_Viewer_GetReportFn_GrapeCity_ActiveReports_Web_Viewer_GetReportDescriptorFn_" data-uid="GrapeCity.ActiveReports.Web.Viewer.ReportViewerConfiguration.UseReportProvider(GrapeCity.ActiveReports.Web.Viewer.GetReportFn,GrapeCity.ActiveReports.Web.Viewer.GetReportDescriptorFn)">UseReportProvider(GetReportFn, GetReportDescriptorFn)</h4>
<div class="markdown level1 summary"><p>Uses a custom report simplistic provider.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public ReportViewerConfiguration UseReportProvider(GetReportFn getReport, GetReportDescriptorFn getReportDescriptor)</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.Web.Viewer.GetReportFn.html">GetReportFn</a></td>
      <td><span class="parametername">getReport</span></td>
      <td><p>A delegate <a class="xref" href="GrapeCity.ActiveReports.Web.Viewer.GetReportFn.html">GetReportFn</a> that retrieves the report
for the specified report identifier.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.ActiveReports.Web.Viewer.GetReportDescriptorFn.html">GetReportDescriptorFn</a></td>
      <td><span class="parametername">getReportDescriptor</span></td>
      <td><p>A delegate <a class="xref" href="GrapeCity.ActiveReports.Web.Viewer.GetReportDescriptorFn.html">GetReportDescriptorFn</a> that retrieves
the report descriptor for the specified report identifier.</p>
</td>
    </tr>
  </tbody>
</table>
<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.Web.Viewer.ReportViewerConfiguration.html">ReportViewerConfiguration</a></td>
      <td><p>The current <a class="xref" href="GrapeCity.ActiveReports.Web.Viewer.ReportViewerConfiguration.html">ReportViewerConfiguration</a> instance.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_Web_Viewer_ReportViewerConfiguration_UseReportProvider_GrapeCity_ActiveReports_Web_Viewer_GetReportFn_GrapeCity_ActiveReports_Web_Viewer_GetReportDescriptorFn__examples">Examples</h5>
<pre><code class="lang-csharp">Stream GetReport(string reportId)
{
	// Your implementation of getting a report.
}

ReportDescriptor GetReportDescriptor(string reportId)
{
	// Your implementation of getting a report description.
}

app.UseReportViewer(config =&gt;
{
	config.UseReportProvider(GetReport, GetReportDescriptor);
});</code></pre>

<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentnullexception">ArgumentNullException</a></td>
      <td><p>Thrown if <code class="paramref">getReport</code> or <code class="paramref">getReportDescriptor</code> is <code>null</code>.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
