Back to Devexpress

IErrorFilteringService Interface

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

latest2.3 KB
Original Source

IErrorFilteringService Interface

Allows you to filter messages shown in the Error List panel (Report Designer)

Namespace : DevExpress.XtraReports.Web.ReportDesigner.Services

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

NuGet Package : DevExpress.Web.Reporting.Common

Declaration

csharp
public interface IErrorFilteringService
vb
Public Interface IErrorFilteringService

Remarks

You can programmatically filter messages shown in the Error List panel:

For this, do the following:

  1. Create a class that implements the IErrorFilteringService interface.
  2. Use the Filter(IEnumerable<ErrorDataContract>) method to modify the collection of errors.
  3. Register the custom class that implements the IErrorFilteringService interface at application startup.

The following code snippet is a service that hides all errors related to report layout:

csharp
class CustomErrorFilter : IErrorFilteringService {
    public IEnumerable<ErrorDataContract> Filter(IEnumerable<ErrorDataContract> errors) {
        return errors.Where(e => e.ErrorSource != DevExpress.XtraReports.Diagnostics.ErrorSource.ReportLayout);
    }
}

Register the CustomErrorFilter service at application startup:

csharp
using DevExpress.XtraReports.Web.ReportDesigner.Services;
// ...
builder.Services.AddScoped<IErrorFilteringService, CustomErrorFilter>();

See Also

IErrorFilteringService Members

DevExpress.XtraReports.Web.ReportDesigner.Services Namespace