Articles in this section
Category / Section

How to set dynamic parameter in ASP.NET WebForms Report Viewer for RDL report?

1 min read

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

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

Set the parameter value dynamically for RDL report

ASP.NET 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.

<form id="form1" runat="server">
    <div style="height: 650px;width: 950px;min-height:404px;">
        <ej:DropDownList ID="DropDownList1" runat="server" SelectedItemIndex="0" ClientSideOnChange="onChange">
                <Items>
                    <ej:DropDownListItem ID="DropDownListItem1" runat="server" Text="10252" Value="10252"/>
                    <ej:DropDownListItem ID="DropDownListItem2" runat="server" Text="10407" Value="10407"/>
                    <ej:DropDownListItem ID="DropDownListItem3" runat="server" Text="10902" Value="10902"/>
                </Items>
        </ej:DropDownList>
        <ej:ReportViewer runat="server" ID="container"  ReportPath="~/App_Data/Invoice.rdl" ReportServiceUrl="/api/ReportApi"/>
    </div>
</form>
 
    <script>
        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-627421731.

 

Note:

A new version of Essential Studio for ASP.NET is available. Versions prior to the release of Essential Studio 2014, Volume 2 will now be referred to as a classic versions.The new ASP.NET suite is powered by Essential Studio for JavaScript providing client-side rendering of HTML 5-JavaScript controls, offering better performance, and better support for touch interactivity. The new version includes all the features of the old version, so migration is easy.

The Classic controls can be used in existing projects; however, if you are starting a new project, we recommend using the latest version of Essential Studio for ASP.NET. Although Syncfusion will continue to support all Classic Versions, we are happy to assist you in migrating to the newest edition.

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