This example demonstrates how to process errors that occur on web reporting controls' server side. This example targets the ASP.NET WebForms platform, but you can use the shown exception handler implementations in ASP.NET MVC applications.
- The ReportDesignerExceptionHandler class is used for the End-User Report Designer control.
- The WebDocumentViewerExceptionHandler class is used for the separate Web Document Viewer control and the Report Designer's built-in Document Viewer.
These classes expose the following methods:
- GetExceptionMessage to handle all possible errors independently from their types;
- GetDocumentCreationExceptionMessage to handle errors related to the document creation process;
- GetFaultExceptionMessage to handle FaultException;
- GetUnknownExceptionMessage to handle other unknown exceptions, for which reporting controls show the standard 'Internal Server Error' message.
This example contains several report layouts and emulates exceptions that can be raised when you work with reporting controls.
The following table lists errors from this example and methods used to process these errors.
Sample Error | Exception Type | Processing Method |
---|---|---|
Broken Report Layout | XmlException | GetUnknownExceptionMessage |
File Not Found | FileNotFoundException | GetUnknownExceptionMessage |
Standard Exception on BeforePrint | NotImplementedException | GetDocumentCreationExceptionMessage |
Custom Exception on BeforePrint | CustomInvalidRangeException (descendant from Exception) | GetDocumentCreationExceptionMessage |
Invalid Report URL (Designer) | FaultException | GetFaultExceptionMessage |
Custom Document Operation (Viewer) | FaultException | GetFaultExceptionMessage |
(you will be redirected to DevExpress.com to submit your response)