Progress® Telerik® Reporting R3 2017

ReportViewerBaseCanMoveToPage Method

Determines whether the viewer can be navigated to a specified page.

Namespace:  Telerik.ReportViewer.WinForms
Assembly:  Telerik.ReportViewer.WinForms (in Telerik.ReportViewer.WinForms.dll)

Syntax

public bool CanMoveToPage(
	int pageIndex
)

Parameters

pageIndex
Type: SystemInt32
The page number to determine navigation possibility.

Return Value

Type: Boolean
Returns true if the viewer can be moved to the specified page.

Examples

// Navigate to a desired page
private void button2_Click(object sender, System.EventArgs e)
{
    var desiredPage = 5;

    // Check if the viewer can navigate to the page since the report may have fewer pages for example
    if (this.reportViewer1.CanMoveToPage(desiredPage))
    {
        // By setting the property the viewer will automatically navigate to the page in question
        this.reportViewer1.CurrentPage = desiredPage;
    }
}

See Also