Gets the number of pages in the current report.
Namespace:
C1.Web.C1WebReportAssembly: C1.Web.C1WebReport.2 (in C1.Web.C1WebReport.2.dll)
Syntax
C# |
---|
[BrowsableAttribute(false)] [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)] public int PageCount { get; } |
Visual Basic (Declaration) |
---|
<BrowsableAttribute(False)> _ <DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)> _ Public ReadOnly Property PageCount As Integer Get |
Remarks
If the report is not paged (Paged property is set to false), this property will always return one.
This property is useful if you want to implement custom navigation bars that show a "Page n of m" message.
Examples
The following code updates a custom navigation bar to show the current page and page count values:
Copy CodeVisual Basic
' update bar state after page changesPrivateSub _c1wr_CurrentPageChanged(sender AsObject, e As System.EventArgs) Dim curr AsInteger = _c1wr.CurrentPage Dim cnt AsInteger = _c1wr.PageCount ' update labelDim str AsString = String.Format("This is page {0} of {1}", curr, cnt) If curr = 1Then str = "This is the first page."ElseIf curr = cnt Then str = String.Format("This is the last page ({0}).", cnt) EndIfEndIf _lblCurrent.Text = str EndSub |
Copy CodeC#
// update bar state after page changesprivatevoid _c1wr_CurrentPageChanged(object sender, System.EventArgs e) { int curr = _c1wr.CurrentPage; int cnt = _c1wr.PageCount; // update labelstring str = string.Format("This is page {0} of {1}", curr, cnt); if (curr == 1) str = "This is the first page."; elseif (curr == cnt) str = string.Format("This is the last page ({0}).", cnt); _lblCurrent.Text = str; } |