Report.GetTotalPages 方法
傳回報表中的軟分頁總數。
命名空間: Microsoft.Reporting.WinForms
組件: Microsoft.ReportViewer.WinForms (在 Microsoft.ReportViewer.WinForms.dll 中)
語法
'宣告
Public Function GetTotalPages As Integer
public int GetTotalPages()
public:
int GetTotalPages()
member GetTotalPages : unit -> int
public function GetTotalPages() : int
傳回值
類型:Int32
包含報表中軟分頁總數的 integer 值。如需軟分頁的詳細資訊,請參閱Understanding Rendering Behaviors。
備註
用來產生總頁數的頁面計數模式取決於 Report 物件轉譯報表的方式。如果報表是使用 Actual 模式轉譯,GetTotalPages 會使用 Actual 頁面計數模式。如果報表是使用 Estimate 模式轉譯,GetTotalPages 會根據報表,使用 Actual 或 Estimate 模式。根據預設,Estimate 模式會用來計算頁數。如需詳細資訊,請參閱 Render 類別和 PageCountMode 方法。
若要擷取用來計算總頁數的頁面計數模式,請使用 GetTotalPages。
當 ReportViewer 控制項為整頁模式時,這個方法永遠會使用 Actualpagecountmode。