Error passing parameter value to application

3 Answers 75 Views
Report Parameters
Alexandre
Top achievements
Rank 2
Iron
Iron
Iron
Alexandre asked on 24 Jun 2023, 06:21 PM

Hello,

I have a report wich has one parameter. When I try to pass a new value in javascript it does not accept it, and uses the sample parameter that is inside the report.

Parameter in the Report:

Passing Parameter in Javascript:

Where 'noFichaVistoria' is the variable containing the new parameter value.

Has anyone faced this before?

Alexandre

3 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay
Telerik team
answered on 30 Jun 2023, 10:23 AM

Hi, Alexandre

A possible cause for this issue is that the report viewer cashed the cached the old version of the viewer "16.1.22.511", instead of taking it version from the Rest Service.

A fix that you can try is to explicitly specify the version you want to use:

you need to change this:

<script src="/api/reports/resources/js/telerikReportViewer"></script>

to this:

<script src="/api/reports/resources/js/telerikReportViewer-17.0.23.315.min.js"></script>

Please note that You may also need to update the Kendo dependencies according to the HTML5 Report Viewer Dependencies for the service version. If you use a custom template for the viewer, you may need to modify it as well.

Regards, Nikolay Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
0
Nikolay
Telerik team
answered on 27 Jun 2023, 01:51 PM

Hello, Alexandre

This problem occurs because in the javascript code the parameter that is being sent is report parameter, while the parameter in the screenshot is a SqlDataSourceParameter, that value is currently set to "93634" and don't know about the value of the report parameter.

To make the the parameters values equal you need to write an expression that set the value of sqlReportParameter to the value of the report parameter in the place of "93634". Expression should look something similar to:

= Parameters.ViewFichaViagem_NoFichaVisitoria.Value.

Regards, Nikolay Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
0
Alexandre
Top achievements
Rank 2
Iron
Iron
Iron
answered on 29 Jun 2023, 05:09 PM

Hello Nikolay,

Thank you for your help. That was really the solution. But now I have a new problem, in my local machine, the report loads without any problem. But in the production server, it gives the following error:

I made sure that only version 17 is being used in the project, so, I do not know why does it say that the Report Viewer is version 16. And, also, why does it work in my local machine but not after published?

Could you help me with that?

Regards,

Alexandre

Tags
Report Parameters
Asked by
Alexandre
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Nikolay
Telerik team
Alexandre
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or