How to handle Report User Action and Parameter Events in blazor app

This tutorial explains how to handle user-driven actions and customize report parameters in the Bold Reports® Web Report Viewer. The video demonstrates how developers can intercept the View Report button click and control parameter rendering behavior before the report generation process starts.


View Report Click

Fires when the user clicks the View Report button. This event allows you to validate, modify, or inspect parameter values before the report rendering begins. You can also cancel the report loading based on custom conditions.

<div id="report-viewer"></div>
<script>
    $("#report-viewer").boldReportViewer({
        viewReportClick: function (args) {
            // Write a code block to perform any action
            // when the View Report button is clicked.
            // args.parameters returns the parameter collection.
            // args.cancel = true; // Cancels report rendering.
        }
    });
</script>

Before Parameter Add

Fires before a parameter element is added to the parameter block in the report viewer. This event enables customization of parameter UI elements, default values, or visibility before they are rendered.

<div id="report-viewer"></div>
<script>
    $("#report-viewer").boldReportViewer({
        beforeParameterAdd: function (args) {
            // Write a code block to modify the parameter element
            // before it is added to the parameter block.
        }
    });
</script>

Implementation Workflow

User Action Handling

Use the viewReportClick event to intercept user actions and apply validations or conditional logic before rendering the report.

Parameter Customization

Use the beforeParameterAdd event to customize parameter appearance, behavior, or default values dynamically.

To get more details about User Action and Parameter Events, you can check this video: