ReportViewer.MaximumPageCount Field

Visual Studio 2010

A constant that represents the maximum number of pages in a report when the current page count mode is Estimate.

Namespace: Microsoft.Reporting.WebForms
Assembly: Microsoft.ReportViewer.WebForms (in microsoft.reportviewer.webforms.dll)

public const int MaximumPageCount
public static final int MaximumPageCount
public const var MaximumPageCount : int

Use MaximumPageCount to specify the last page of a report even when you do not have the maximum page count.

To navigate to the last page of a report when the current page count mode is Estimate, set the CurrentPage property to MaximumPageCount. If you do this in Actual mode, the ReportViewer throws an InvalidOperationException.

Certain operations cause the ReportViewer control to calculate the actual total number of pages, such as exporting a report or navigating to the last page of the report. Before setting the CurrentPage property to MaximumPageCount, you should verify that the current page count is an estimated page count by using the GetTotalPages method in the LocalReport or ServerReport object.

Show: