ActiveReports 19 .NET Edition
MESCIUS.ActiveReports.Viewer.Win Assembly / GrapeCity.ActiveReports.Viewer.Win Namespace / Viewer Class / LoadCompleted Event
Example

In This Topic
    LoadCompleted Event (Viewer)
    In This Topic
    Occurs after the document has been fully loaded and rendered in the viewer. public partial class MyForm : Form { private Viewer viewer; public MyForm() { InitializeComponent(); // Initialize the viewer viewer = new Viewer(); this.Controls.Add(viewer); // Subscribe to the LoadCompleted event viewer.LoadCompleted += Viewer_LoadCompleted; } private void Viewer_LoadCompleted(object sender, EventArgs e) { // Handle the LoadCompleted event // For example, update the status bar with the total number of pages statusBarLabel.Text = $"Total Pages: {viewer.Document.Pages.Count}"; } }
    Syntax
    'Declaration
     
    Public Event LoadCompleted As LoadCompletedEventHandler
    public event LoadCompletedEventHandler LoadCompleted
    Remarks
    The System.EventArgs may provide additional details about the load operation. This event can be used to perform actions that should only occur after the entire document is available for viewing, such as enabling document navigation controls.
    Example
    public partial class MyForm : Form
    {
    	private Viewer viewer;
    	public MyForm()
    	{
    		InitializeComponent();
    		// Initialize the viewer
    		viewer = new Viewer();
    		this.Controls.Add(viewer);
    		// Subscribe to the LoadCompleted event
    		viewer.LoadCompleted += Viewer_LoadCompleted;
    	}
    	private void Viewer_LoadCompleted(object sender, EventArgs e)
    	{
    		// Handle the LoadCompleted event
    		// For example, update the status bar with the total number of pages
    		statusBarLabel.Text = $"Total Pages: {viewer.Document.Pages.Count}";
    	}
    }
    See Also