How to handle Report Load and Error Events in Blazor App
This tutorial explains how to handle report loading and error‑related events in the Bold Reports® Web Report Viewer within a Blazor application. The video demonstrates how developers can track successful report loading and manage errors that occur during report processing or rendering.
Report Loaded
Fires when the report is loaded successfully. This event can be used to perform actions once the report is rendered and ready for user interaction.
<div id="report-viewer"></div>
<script>
$("#report-viewer").boldReportViewer({
reportLoaded: function (args) {
// Write a code block to perform any action
// when the report is loaded successfully.
}
});
</script>Report Error
Fires when an error occurs during report processing or rendering. This event allows you to capture error details and perform custom actions such as logging or displaying messages.
<div id="report-viewer"></div>
<script>
$("#report-viewer").boldReportViewer({
reportError: function (args) {
// Write a code block to perform any action
// when a report error occurs.
}
});
</script>Show Error
Fires when the user clicks a failed report item in the rendered report, before displaying the error details dialog. This event allows you to customize or cancel the default error dialog behavior.
<div id="report-viewer"></div>
<script>
$("#report-viewer").boldReportViewer({
showError: function (args) {
// Write a code block to perform any action
// before showing the error details dialog.
// args.cancel = true; // Cancels the default error dialog.
}
});
</script>Implementation Workflow
Report Load Tracking
Use the report Loaded event to determine when a report has been successfully rendered.
Error Handling
Use the report Error and show Error events to capture failures and control how error information is presented to users.
To get more details about Report Load and Error Events in Blazor applications, you can check this video: