Back to Devexpress

ReportDesignerExceptionHandler Class

xtrareports-devexpress-dot-xtrareports-dot-web-dot-reportdesigner-dot-services-3a4c3747.md

latest4.9 KB
Original Source

ReportDesignerExceptionHandler Class

Enables you to handle server-side errors in the Web Report Designer.

Namespace : DevExpress.XtraReports.Web.ReportDesigner.Services

Assembly : DevExpress.XtraReports.v25.2.Web.dll

NuGet Package : DevExpress.Web.Reporting.Common

Declaration

csharp
public class ReportDesignerExceptionHandler :
    ExceptionHandler,
    IReportDesignerExceptionHandler,
    IExceptionHandler
vb
Public Class ReportDesignerExceptionHandler
    Inherits ExceptionHandler
    Implements IReportDesignerExceptionHandler,
               IExceptionHandler

Remarks

The ReportDesignerExceptionHandler class provides the following methods:

The code snippet below demonstrates how to create a descendant from this class and override the GetUnknownExceptionMessage method to return an actual exception message.

csharp
using System;
using DevExpress.XtraReports.Web.ReportDesigner.Services;

public class CustomReportDesignerExceptionHandler : ReportDesignerExceptionHandler {
    public override string GetUnknownExceptionMessage(Exception ex) {
        return ex.Message;
    }
}
vb
Imports System
Imports DevExpress.XtraReports.Web.ReportDesigner.Services

Public Class CustomReportDesignerExceptionHandler
    Inherits ReportDesignerExceptionHandler

    Public Overrides Function GetUnknownExceptionMessage(ByVal ex As Exception) As String
        Return ex.Message
    End Function
End Class

To register the implemented exception handler, use the static DefaultReportDesignerContainer.Register method at the application’s startup as shown below:

csharp
void Application_Start(object sender, EventArgs e) {
    // ...
    DevExpress.XtraReports.Web.ReportDesigner.DefaultReportDesignerContainer.
        Register<IReportDesignerExceptionHandler, CustomReportDesignerExceptionHandler>();
}
vb
Private Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
    ' ...
    DevExpress.XtraReports.Web.ReportDesigner.DefaultReportDesignerContainer.
        Register(Of IReportDesignerExceptionHandler, CustomReportDesignerExceptionHandler)()
End Sub

See the following topics for more information:

Implements

IReportDesignerExceptionHandler

IExceptionHandler

Inheritance

Object ExceptionHandler ReportDesignerExceptionHandler

See Also

ReportDesignerExceptionHandler Members

DevExpress.XtraReports.Web.ReportDesigner.Services Namespace