# C1.WPF.ReportViewer.C1ReportViewer.LoadDocument

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_WPF_ReportViewer_C1ReportViewer_LoadDocument_" data-uid="C1.WPF.ReportViewer.C1ReportViewer.LoadDocument*">LoadDocument Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_WPF_ReportViewer_C1ReportViewer_LoadDocument_" data-uid="C1.WPF.ReportViewer.C1ReportViewer.LoadDocument*"></a>
<h4 id="C1_WPF_ReportViewer_C1ReportViewer_LoadDocument_System_String_System_String_" data-uid="C1.WPF.ReportViewer.C1ReportViewer.LoadDocument(System.String,System.String)">LoadDocument(string, string)</h4>
<div class="markdown level1 summary"><p>Load a PDF or HMTL document from a file.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void LoadDocument(string fileName, string password = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub LoadDocument(fileName As String, Optional password As String = Nothing)</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="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">fileName</span></td>
      <td><p>The name of the file that contains the PDF or HTML document.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">password</span></td>
      <td><p>A user password for a a PDF document.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_WPF_ReportViewer_C1ReportViewer_LoadDocument_System_String_System_String__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>To load a document from an HTML string, use the <a class="xref" href="C1.WPF.ReportViewer.C1ReportViewer.LoadDocumentFromString.html#C1_WPF_ReportViewer_C1ReportViewer_LoadDocumentFromString_System_String_">LoadDocumentFromString(string)</a> method.</p>
</div>


<a id="C1_WPF_ReportViewer_C1ReportViewer_LoadDocument_" data-uid="C1.WPF.ReportViewer.C1ReportViewer.LoadDocument*"></a>
<h4 id="C1_WPF_ReportViewer_C1ReportViewer_LoadDocument_System_IO_Stream_System_String_" data-uid="C1.WPF.ReportViewer.C1ReportViewer.LoadDocument(System.IO.Stream,System.String)">LoadDocument(Stream, string)</h4>
<div class="markdown level1 summary"><p>Load a PDF or HTML document from a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void LoadDocument(Stream stream, string password = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub LoadDocument(stream As Stream, Optional password As String = Nothing)</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="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a></td>
      <td><span class="parametername">stream</span></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a> containing a PDF or HTML document.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">password</span></td>
      <td><p>A user password for a a PDF document.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
