I really want to let the users know whenever an error or exception occurs while a report is generated. I use a ReportViewer to display my reports and I have an errorlabel placed above the viewer.
It is possible, due to rights, that a user cannot retrieve certain data and therefore the viewer throws an error message, but I want to show an "informative" message in an errorlabel outside the report, above the viewer itself on the .aspx page. Whenever this error or exception occurs I want to NOT generate the report (just abort it and show no report) and display corresponding error message in the errorlabel on the aspx page.
In my code-behind of my .aspx page I have the following:
For all of you, I don't use a ReportProcessor, so the Error event of it cannot be used. The Error event of the report itself cannot be used as well, because it's located in another DLL and not accessible in my .aspx page. So why isn't there an event such as the Error event of the ReportProcessor and report for the ReportViewer?
I really want to solve this, because I don't want to show the users a report with only an error in it. I don't want to show the report at all if an error/exception occurs and this error/exception details should be displayed in the errorlabel.
Looking forward to a solution or workaround! Thanks in advance!
6 Answers, 1 is accepted
Report handling is time consuming task. Thus to improve the user experience we let the page to render and after that report handler is processing reports. At the moment when report error occurs the page is already rendered and changing control properties will not have the expected result. Thus our suggestion is to design your reports in an error proof way and eliminate any error while designing the reports.
Still if for any reason this is not applicable for your scenario. In order to check for errors to hide the report error and show custom message you have to subscribe for Report.Error event, do a test report rendering and if the error handler is fired do the necessary updates as shown in the following code snippet:
the Telerik team
In case of the report be shown by using the Silverlight ReportViewer.
How can I catch the report exception when the executed mdx query against OLAP cube has exception?
At this moment,I use the Telerik.Reporting Version is 184.108.40.2060.
Please see the code below
I create the report instance by using the "ReportService.svc" wcf service.
I can only set the completely named report for the Silverlight ReportViewer's Report Property.
How should I do ?
I am in urgent need of yours help.Thanks
I am facing time out exceptions in case the data set is large. I need to show friendly message incase there is any exception being thrown by the report. I have tried the solution provided by you, but still the error message is displayed inside the report viewer control. Can you please provide complete solution for showing friendly message in a label control when an unhandled exception occurs.
I have the exact same issue as Wang's (Posted on Dec 29, 2011). The reportviewer in my silverlight application fetches the report generated from service. I may get unexpected exception in which case I do NOT want to load the report with exception. Instead I would just like to display 'No Report'.
I am using version 220.127.116.117 of Reportviewer.
Is there a way to check for the exception and prevent loading the report with exception yet? Urgently in need of a solution for this.
I use the reportservice client to handle service related errors:
As you see on error I collapse the viewer, another option is to show a viewer that displays no report or anything else to alert the user about the error.