Articles in this section
Category / Section

How to set dynamic parameter in JS ReportViewer for RDL report?

2 mins read

This article describes how to set the dynamic parameter values for the RDL report in JavaScript ReportViewer control. You can create a ReportViewer sample in JavaScript by referring the below Getting Started documentation:

https://help.syncfusion.com/js/reportviewer/getting-started

 

Set the parameter value dynamically for RDL report: 

JavaScript ReportViewer has support to set the dynamic parameter values for the RDL report in client side. You can set the parameter value for the RDL report dynamically by using the setModel method as shown in below code example.

 

    <div style="height: 600px; width: 1250px; min-height: 524px;" id="container"></div>
    <script type="text/javascript">
        $(function () {
            $('#dropdown1').ejDropDownList({
                change: "onChange",
                selectedItemIndex: 0
            });
            $("#container").ejReportViewer(
                        {
                            reportServiceUrl: "/api/ReportAPI",
                            reportPath: '~/App_Data/Invoice.rdl',
                            processingMode: ej.ReportViewer.ProcessingMode.Remote,
                        });
        });
 
        function onChange(args) {           
            var reportObject = $("#container").data("ejReportViewer");
            reportObject.setModel({ parameters: [{
                name: 'InvoiceID',
                labels: [args.selectedValue],
                values: [args.selectedValue],
                nullable: false
            }] });
        }
    </script>

 

Demo Sample:

You can download the Demo Sample from the following link.

https://www.syncfusion.com/downloads/support/directtrac/general/ze/ReportViewer_Set_Parameter-1905893651.zip

 

 

Conclusion

I hope you enjoyed learning about how to set dynamic parameter in JS ReportViewer for RDL report.

You can refer to our JavaScript Report Viewer feature tour page to learn about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our JavaScript Report Viewer example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied