How to catch report error before printing the report?

1 Answer 44 Views
.NET 5 General Discussions Report Viewer - HTML5
Tursunkhuja
Top achievements
Rank 2
Iron
Veteran
Tursunkhuja asked on 14 Sep 2021, 12:29 PM | edited on 15 Sep 2021, 05:55 AM

Hi,

When processing report, an error can occur. Report error can be different. For example:

  • When a report has OData connection and if the OData request doesn't execute successfully (see "ErrorWhenODataRequestIsNotSuccess.PNG" attached file).
  • When a report shows error while processing report item (for example, when we bind wrong parameter name to TextBox. See "Error while processing report item.PNG" attached file)
  • etc.

When we print the report (or export to PDF file), it will continue printing the report which has an error in its content (see Print report with error.PNG file). The question is, how we should catch the report error before start printing? We use HTML5 report viewer to show report, we use Syncfusion package to print pdf format of our report, and also in backend side implemented our customer report resolver. We don't require printing wrong report. But, we want to do some actions before printing wrong report.

Thank you, 

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 17 Sep 2021, 06:49 AM

Hello Tursunkhuja,

Indeed, when there is an error in the rendering of a report item, it will be replaced by a red error message. This is by design and the purpose is to show to the user that there is a problem with a particular item.

In order to catch and process Report errors, you need to use the Report.Error Event. I suggest the KB article Error handling in Reports and Report Viewers for more details.

Regards,
Todor
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
Tags
.NET 5 General Discussions Report Viewer - HTML5
Asked by
Tursunkhuja
Top achievements
Rank 2
Iron
Veteran
Answers by
Todor
Telerik team
Share this question
or