Parameterized Queries Telerik Report Server Web Designer & Standalone Designer

1 Answer 14 Views
Let's talk about telerik (the good and the bad)
Patrick
Top achievements
Rank 1
Patrick asked on 21 Feb 2024, 04:19 PM
 I am attempting to incorporate a data source parameter and a report parameter to create a parameterized query. I am certain my report parameter has values and can pass the correct value and data type I went (I create a text box to display the report parameter value and it did so correctly. However, the moment I then change my SQL query to include the parameter and then make the data source parameter equal to the value of my report parameter it does not work as intended.  Once I set the data source parameter value equal to the report parameter value and hit preview all available parameter value options disappear and nothing loads. 

1 Answer, 1 is accepted

Sort by
0
Momchil
Telerik team
answered on 26 Feb 2024, 09:55 AM

Hi Patrick,

Without taking a look at the report definition, I can only guess but here are some general pitfalls to look out for.

1. Make sure there is no circular dependency. For example, the report parameter has available values, and the data source used for the available values depends on the value of the same report parameter.

2. Check whether the SQL data source parameter syntax is correct for your chosen data provider. The following documentation article describes the correct syntax for some of the more common data providers.

Using Parameters with the SqlDataSource Component

If the above does not help, please trim all sensitive information, such as embedded connection strings, from your report, share it with me, and I will try to propose something more concrete.

Best Regards,
Momchil
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Patrick
Top achievements
Rank 1
commented on 28 Feb 2024, 04:47 PM

I am troubleshooting at the moment in regards to circular dependency. If what I try does not work I will send what I have. Is there anyway to set a default value for a parameter or no? 
Dimitar
Telerik team
commented on 04 Mar 2024, 12:10 PM

Yes, the default value of the report parameter can be set from the ReportParameter.Value property.
Tags
Let's talk about telerik (the good and the bad)
Asked by
Patrick
Top achievements
Rank 1
Answers by
Momchil
Telerik team
Share this question
or