Back to Devexpress

DocumentViewerBase.ShowPage(IPage) Method

windowsforms-devexpress-dot-documentview-dot-controls-dot-documentviewerbase-dot-showpage-x28-devexpress-dot-documentview-dot-ipage-x29.md

latest2.5 KB
Original Source

DocumentViewerBase.ShowPage(IPage) Method

Shows the specified page in the Document Viewer.

Namespace : DevExpress.DocumentView.Controls

Assembly : DevExpress.Utils.v25.2.dll

NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core

Declaration

csharp
public void ShowPage(
    IPage page
)
vb
Public Sub ShowPage(
    page As IPage
)

Parameters

NameTypeDescription
pageIPage

An object implementing the IPage interface. (Typically, this is a Page object.)

|

Remarks

The following example demonstrates the ShowPage property in action.

csharp
using System;
using System.Windows.Forms;
// ...

private void Form1_Load(object sender, EventArgs e) {
    // Create a report and assign it to the Document Viewer instance.
    XtraReport1 report = new XtraReport1();
    this.documentViewer1.DocumentSource = report;

    // Create a paginated report document.
    report.CreateDocument(false);

    // Show the document's fourth page in the Document Viewer.
    this.documentViewer1.ShowPage(report.PrintingSystem.Pages[3]);
}
vb
Imports System
Imports System.Windows.Forms
' ... 

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
    ' Create a report and assign it to the Document Viewer instance. 
    Dim report As New XtraReport1()
    Me.documentViewer1.DocumentSource = report

    ' Create a paginated report document. 
    report.CreateDocument(False)

    ' Show the document's fourth page in the Document Viewer. 
    Me.documentViewer1.ShowPage(report.PrintingSystem.Pages(3))
End Sub

See Also

DocumentViewerBase Class

DocumentViewerBase Members

DevExpress.DocumentView.Controls Namespace