ReportViewer.MaximumPageCount Field

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)

Syntax

'Declaration
Public Const MaximumPageCount As Integer
'Usage
Dim value As Integer

value = ReportViewer.MaximumPageCount
public const int MaximumPageCount
public:
literal int MaximumPageCount
public static final int MaximumPageCount
public const var MaximumPageCount : int

Remarks

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.

See Also

Reference

ReportViewer Class
ReportViewer Members
Microsoft.Reporting.WebForms Namespace