# GrapeCity.ActiveReports.Blazor.Designer.PreviewSettings

## Content

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



  <h1 id="GrapeCity_ActiveReports_Blazor_Designer_PreviewSettings" data-uid="GrapeCity.ActiveReports.Blazor.Designer.PreviewSettings" class="text-break">PreviewSettings Class
</h1>
  <div class="markdown level0 summary"><p>Represents settings related to the document preview functionality, allowing configuration of the preview button visibility and integration of a viewer component.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><span class="xref">PreviewSettings</span></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="GrapeCity.ActiveReports.Blazor.Designer.html">GrapeCity.ActiveReports.Blazor.Designer</a></h6>
  <h6><strong>Assembly</strong>: MESCIUS.ActiveReports.Blazor.Designer.dll</h6>
  <h5 id="GrapeCity_ActiveReports_Blazor_Designer_PreviewSettings_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class PreviewSettings</code></pre>
  </div>
  <h5 id="GrapeCity_ActiveReports_Blazor_Designer_PreviewSettings_examples"><strong>Examples</strong></h5>
  <pre><code class="lang-csharp">private PreviewSettings _preview;
public Index()
{
    _preview = new PreviewSettings()
    {
        CanPreview = true,
        OpenViewer = OpenViewer
    };
}

private async void OpenViewer(ViewerSettings settings)
{
    if (_viewer != null)
    {
	    await _viewer.OpenReport(settings.DocumentInfo.Id);
	    return;
    }
    _viewer = new ReportViewer();
    var initOptions = new InitializationOptions();
    initOptions.ReportID = settings.DocumentInfo.Id;
    await _viewer.Render(JSRuntime, settings.Element, initOptions);
}</code></pre>

  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="GrapeCity_ActiveReports_Blazor_Designer_PreviewSettings__ctor" data-uid="GrapeCity.ActiveReports.Blazor.Designer.PreviewSettings.#ctor">
          <a class="xref" href="GrapeCity.ActiveReports.Blazor.Designer.PreviewSettings.-ctor.html#GrapeCity_ActiveReports_Blazor_Designer_PreviewSettings__ctor">PreviewSettings()</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
    </tbody>
  </table>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="GrapeCity_ActiveReports_Blazor_Designer_PreviewSettings_CanPreview" data-uid="GrapeCity.ActiveReports.Blazor.Designer.PreviewSettings.CanPreview">
          <a class="xref" href="GrapeCity.ActiveReports.Blazor.Designer.PreviewSettings.CanPreview.html#GrapeCity_ActiveReports_Blazor_Designer_PreviewSettings_CanPreview">CanPreview</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value indicating whether the Preview button should be shown.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_ActiveReports_Blazor_Designer_PreviewSettings_OpenViewer" data-uid="GrapeCity.ActiveReports.Blazor.Designer.PreviewSettings.OpenViewer">
          <a class="xref" href="GrapeCity.ActiveReports.Blazor.Designer.PreviewSettings.OpenViewer.html#GrapeCity_ActiveReports_Blazor_Designer_PreviewSettings_OpenViewer">OpenViewer</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a function to plug in a viewer component, which will be called when the preview is opened.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
