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

Multivalue issues - setting value in C#

1 Answer 392 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Timothy
Top achievements
Rank 1
Timothy asked on 30 Sep 2020, 03:34 PM
I’m trying to pass in a list of integer IDs from within C# by setting a Telerik.Reporting.ReportParameter.Value.  I have tried a number of combinations of object types, from passing in a string of comma separated values to passing in an IEnumerable of Integers to no avail.  I have tried using the Array function on Designer side, but no matter what combination I try, I’m receiving an error that the value for WidgetIDList is invalid.  I was wondering what the object should look like that I set in the C# code, and what I should set the Value in the Telerik Report Designer for the parameter that will be passed to the stored procedure to generate results.  I’ve gone over the notes on the website over and over, and looked at a few articles on workarounds posted here, and still haven’t been able to determine a solution.  I would try to pass a string of comma separated values, but our UI relies on the AvailableValues to be set so that it can populate a dropdown list in our UI for the user to select from.  I'm wondering if that's what's causing the issue, the validation not liking what I'm passing. Thanks for your assistance.

Parameter being passed in
Name: WidgetIDList
AllowBlank: False
AllowNull: False
AvailableValues: dsGetAllWidgetNames [Telerik.Reporting.SqlDataSource] (This is a SQLDataSource that uses a connection string to call a stored procedure to populate the values.)
DataSource: dsGetAllWidgetNames [Telerik.Reporting.SqlDataSource]
DisplayMember: = Fields.WidgetName
Filters: (No Filters)
Sortings: (No sorting)
ValueMember: = Fields.WidgetID
Mergeable: True
MultiValue: True
Name: WidgetIDList
Text: Widget
Type: Integer
Value:
Visible: True

Parameter to be passed to Stored Procedure to generate results
@WidgetIDList: Telerik.Reporting.SqlDataSourceParameter
DBType: AnsiString
Name: @WidgetIDList
Value:

1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 05 Oct 2020, 01:49 PM

Hi Timothy,

I would suggest to check How to use MultiValue Report Parameter in a SQL query KB article. If you need any additional help, please, provide us more details about the scenario, which report designer do you use and how exactly do you bind the datasource to the report.

Regards,
Neli
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
Timothy
Top achievements
Rank 1
Answers by
Neli
Telerik team
Share this question
or