# C1.Ssrs.ReportSession.GetPageCount

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Ssrs_ReportSession_GetPageCount_" data-uid="C1.Ssrs.ReportSession.GetPageCount*">GetPageCount Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Ssrs_ReportSession_GetPageCount_" data-uid="C1.Ssrs.ReportSession.GetPageCount*"></a>
<h4 id="C1_Ssrs_ReportSession_GetPageCount_C1_Ssrs_ReportSession_ReportFormat_C1_Ssrs_PageLayout_System_Threading_CancellationToken_" data-uid="C1.Ssrs.ReportSession.GetPageCount(C1.Ssrs.ReportSession.ReportFormat,C1.Ssrs.PageLayout,System.Threading.CancellationToken)">GetPageCount(ReportFormat, PageLayout, CancellationToken)</h4>
<div class="markdown level1 summary"><p>Returns count of pages in the report.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int GetPageCount(ReportSession.ReportFormat format, PageLayout pageLayout, CancellationToken cancellationToken)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GetPageCount(format As ReportSession.ReportFormat, pageLayout As PageLayout, cancellationToken As CancellationToken) As Integer</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="C1.Ssrs.ReportSession.html">ReportSession</a>.<a class="xref" href="C1.Ssrs.ReportSession.ReportFormat.html">ReportFormat</a></td>
      <td><span class="parametername">format</span></td>
      <td><p><a class="xref" href="C1.Ssrs.ReportSession.ReportFormat.html">ReportSession.ReportFormat</a> object specifies the report format.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.Ssrs.PageLayout.html">PageLayout</a></td>
      <td><span class="parametername">pageLayout</span></td>
      <td><p><a class="xref" href="C1.Ssrs.PageLayout.html">PageLayout</a> object specifies the page settings, this parameter used only for PDF and IMAGE formats.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken">CancellationToken</a></td>
      <td><span class="parametername">cancellationToken</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken">CancellationToken</a> that can be used to cancel an action.</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="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><p>Count of pages or -1 if actions was canceled.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
