ReportViewer.MaximumPageCount 欄位
發佈時間: 2016年4月
常數,表示目前的頁面計數模式為 Estimate 時,報表中的最大頁數。
命名空間: Microsoft.Reporting.WinForms
組件: Microsoft.ReportViewer.WinForms (在 Microsoft.ReportViewer.WinForms.dll 中)
語法
public const int MaximumPageCount
public:
literal int MaximumPageCount
static val mutable MaximumPageCount : int
Public Const MaximumPageCount As Integer
欄位值
Type: System.Int32
備註
即使您不知道最大頁數,也可以使用 MaximumPageCount 指定報表的最後一頁。
若要在目前的頁面計數模式為 Estimate 時巡覽至報表的最後一頁時,請將 CurrentPage 屬性設定為 MaximumPageCount。如果您在 Actual 模式中這麼做,ReportViewer 會擲回 InvalidOperationException。
有些作業會使得 ReportViewer 控制項計算實際總頁數,例如匯出報表或巡覽至報表的最後一頁。將 CurrentPage 屬性設定為 MaximumPageCount 之前,您應該使用 LocalReport 或 ServerReport 物件中的 GetTotalPages 方法,確認目前的頁面計數是估計頁數。
請參閱
ReportViewer 類別
Microsoft.Reporting.WinForms 命名空間
回到頁首