This is a migrated thread and some comments may be shown as answers.

How use IN operator on SqlDataSource

1 Answer 369 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Fernando
Top achievements
Rank 1
Fernando asked on 20 May 2016, 01:56 PM
Hi guys,

I am using Telerik Reporting R2 2016 and I need to create a query in a SqlDataSource which has a IN operator that should use an parameter. For sample, I have list of IDs (Supplier Id) that will be passed into the report and I need to apply it using the IN operator on the dataSource. How can I do it on Telerik Report?

I tried to configure a query on the SqlDataSource like this:

select s.* from suppliers s where s.Id in (:Ids)

And after that I tried to run by Telerik Report Design and keep the :Ids parameter as string, int32 or object does not work. I fiil up the parameter like 1,2,3 (separated by comma) but I get an Oracle exception saying it is not a valid number. How can I define a string parameter on the report and pass it to the report?

(i will use it on a asp.net mvc using the javascript/html5 telerik reporting viewer).

Thank you.

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 25 May 2016, 09:52 AM
Hi Fernando,

The :Ids SQL parameter must be mapped to a multivalue report parameter. This is step 4 of the SqlDataSource Wizard. As a design-time value to get the data schema you can pass a single value (step 5).

Further details about how to configure the SQL query and report parameters are discussed in the How pass multivalues param values to report MVC or HTML5? forum thread.


I hope this information is helpful.

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Fernando
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or