How to use Bold Reports® Progress and Ajax Events
This tutorial explains how to track export and print progress, and how to intercept AJAX requests in the Bold Reports® Web Report Viewer. The video demonstrates how developers can monitor long-running operations and customize server communication during report processing.
Key Events Explained
Export Progress Changed
Fires whenever the export progress changes. This event is useful for showing custom progress indicators during report export.
<div id="report-viewer"></div>
<script>
$("#report-viewer").boldReportViewer({
exportProgressChanged: function (args) {
// Write a code block to perform any action when export progress changes.
}
});
</script>Print Progress Changed
Triggers when the print operation progresses. This event can be used to display printing status information.
<div id="report-viewer"></div>
<script>
$("#report-viewer").boldReportViewer({
printProgressChanged: function (args) {
// Write a code block to perform any action when print progress changes.
}
});
</script>AJAX Before Load
Fires before an AJAX request is sent to the server. This event allows you to modify headers, tokens, or request data.
<div id="report-viewer"></div>
<script>
$("#report-viewer").boldReportViewer({
ajaxBeforeLoad: function (args) {
// Write a code block to modify headers or request data before AJAX call.
}
});
</script>AJAX Success
Triggered when an AJAX request completes successfully. This event helps in tracking responses from the server.
<div id="report-viewer"></div>
<script>
$("#report-viewer").boldReportViewer({
ajaxSuccess: function (args) {
// Write a code block to perform any action after successful AJAX response.
}
});
</script>AJAX Error
Fires when an AJAX request fails. This event is useful for handling network or server-side errors.
<div id="report-viewer"></div>
<script>
$("#report-viewer").boldReportViewer({
ajaxError: function (args) {
// Write a code block to handle AJAX request errors.
}
});
</script>Implementation Workflow
Progress Tracking
Use export and print progress events to track and display real-time status during long-running operations.
AJAX Customization
Leverage AJAX life cycle events to inject authorization tokens, custom headers, or error handling logic into server communication.
If you want more details about Progress and AJAX Events, you can check this video: