Parameters passed to report by Javascript not working

0 Answers 83 Views
.NET Core Report Parameters Report Viewer - HTML5
Lloyd
Top achievements
Rank 1
Lloyd asked on 22 Jun 2022, 09:12 AM

Hi,

 

I am using the HTML5 viewer under .Net 6. I have 2 parameters CICAreaFilter and SubReportVisible.

I am using this Javascript to pass values to these parameters:

        $(document).ready(function () {

            $("#reportViewer1")
                .telerik_ReportViewer({
                    serviceUrl: "api/reports",
                    reportSource: { report: "First Attempt.trdp" },
                    parameters: [ { CICAreaFilter: 'GEN' }, { SubReportVisible: true }],
                    scaleMode: telerikReportViewer.ScaleModes.SPECIFIC,
                    scale: 1.0
                });
        });

The parameters are not being set in the report. What do I need to change to get these parameters to work? I have tried 1 parameter and it also does not work.

 

Thanks.

 

Lloyd.

Neli
Telerik team
commented on 23 Jun 2022, 10:38 AM

Hi Lloyd,

The parameters should be set in the reportSource. For example

reportSource: {
                        report: "Report Catalog.trdp",
                        // Parameters name value dictionary
                        //parameters: {}
                        // Example of passing an array [] of parameters-values to the parameter 'Year'
                        parameters: { Year: [2001, 2003, 2004] }
                    },

I hope this information will help you. Please, let me know if you need further assistance.

No answers yet. Maybe you can help?

Tags
.NET Core Report Parameters Report Viewer - HTML5
Asked by
Lloyd
Top achievements
Rank 1
Share this question
or