共用方式為


ReportViewer.MaximumPageCount 欄位

常數,表示目前的頁面計數模式為 Estimate 時,報表中的最大頁數。

命名空間:  Microsoft.Reporting.WinForms
組件:  Microsoft.ReportViewer.WinForms (在 Microsoft.ReportViewer.WinForms.dll 中)

語法

'宣告
Public Const MaximumPageCount As Integer
'用途
Dim value As Integer

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

備註

即使您不知道最大頁數,也可以使用 MaximumPageCount 指定報表的最後一頁。

若要在目前的頁面計數模式為 Estimate 時巡覽至報表的最後一頁時,請將 CurrentPage 屬性設定為 MaximumPageCount。如果您在 Actual 模式中這麼做,ReportViewer 會擲回 InvalidOperationException

有些作業會使得 ReportViewer 控制項計算實際總頁數,例如匯出報表或巡覽至報表的最後一頁。將 CurrentPage 屬性設定為 MaximumPageCount 之前,您應該使用 LocalReportServerReport 物件中的 GetTotalPages 方法,確認目前的頁面計數是估計頁數。

請參閱

參考

ReportViewer 類別

Microsoft.Reporting.WinForms 命名空間