How to use Rendering and Report Events in ASP.NET Core
This tutorial explains how to handle rendering and report-related events in the Bold Reports® Web Report Viewer within an ASP.NET Core application. The video demonstrates how to hook into various stages of the report life cycle to track rendering progress, handle export actions, and customize the toolbar behavior.
Key Events Explained
renderingBegin
Fires before the report rendering process starts. This event can be used to perform actions such as displaying loading indicators or validating conditions before rendering.
<div id="report-viewer"></div>
<script>
$("#report-viewer").boldReportViewer({
renderingBegin: function (args) {
// Write a code block to perform any operation before rendering begins.
}
});
</script>Rendering Complete
Triggered after the report has been rendered completely. This event is useful for executing post-rendering logic.
<div id="report-viewer"></div>
<script>
$("#report-viewer").boldReportViewer({
renderingComplete: function (args) {
// Write a code block to perform any operation after rendering is completed.
}
});
</script>Report Export
Fires when the report export process is initiated. This event allows you to intercept or customize export behavior.
<div id="report-viewer"></div>
<script>
$("#report-viewer").boldReportViewer({
reportExport: function (args) {
// Write a code block to perform any operation before exporting the report.
}
});
</script>Report Canceled
Triggered when the report rendering or export process is canceled by the user. This event helps in handling cleanup or UI reset operations.
<div id="report-viewer"></div>
<script>
$("#report-viewer").boldReportViewer({
reportCanceled: function (args) {
// Write a code block to perform any action when report processing is canceled.
}
});
</script>Toolbar Rendering
Occurs when the report viewer toolbar is being rendered. This event allows customization of toolbar items before they appear in the UI.
<div id="report-viewer"></div>
<script>
$("#report-viewer").boldReportViewer({
toolbarRendering: function (args) {
// Write a code block to customize the report viewer toolbar.
}
});
</script>Implementation Workflow
Application Setup
Create an ASP.NET Core web application and configure the necessary Bold Reports® scripts, styles, and service endpoints.
Viewer Initialization
Add the Report Viewer container to the Razor or HTML page and initialize it with the required configuration settings.
Event Wiring
Attach JavaScript functions to the Report Viewer events to monitor and control report rendering, exporting, cancellation, and toolbar customization.
If you want more details about Rendering and Report Events in ASP.NET Core, you can check this video: