[]
        
(Showing Draft Content)

GrapeCity.ActiveReports.Viewer.Win.Viewer.HandleError

HandleError Method

HandleError(Exception)

Handles runtime errors by reporting them to the viewer's model for appropriate action.

Declaration
public void HandleError(Exception ex)
Parameters
Type Name Description
Exception ex

The exception that occurred during runtime. This exception is passed to the viewer model for processing and potentially displaying an error message to the user.

Remarks

This method is intended to centralize error handling within the viewer control. It allows for a consistent approach to managing exceptions, such as logging errors or informing the user through the UI. The actual handling strategy is implemented within the viewer model.

Examples
// Instantiating the Viewer control and adding it to a form.
Viewer viewer = new Viewer();
viewer.Dock = DockStyle.Fill;
this.Controls.Add(viewer);
// Example of handling an error that might occur during document loading.
try
{
    viewer.LoadDocument("path/to/your/report.rdlx");
}
catch (Exception ex)
{
    viewer.HandleError(ex);
}