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

Error message passing Multivalue

3 Answers 143 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Ravi
Top achievements
Rank 1
Ravi asked on 03 Sep 2012, 05:50 AM
Hello Adimn,

I am passing A multi Value  throught parameter to a stored procedure and When a multivalue is passed to a parameter it fails as you have too many arguments when ever i select multi value parameter.
Can you please assit me how to pass a Multi value parameter.


Thanks,
Ravi

3 Answers, 1 is accepted

Sort by
0
Elian
Telerik team
answered on 06 Sep 2012, 02:11 PM
Hi Ravi,

You can find detailed info on using multi-value parameters in our documentation: Using Multivalue Parameters.
 
Kind regards,
Elian
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
Ravi
Top achievements
Rank 1
answered on 06 Sep 2012, 04:26 PM
I am not using a Query but i am using a Stored procedure and pass parameter to the procedure which is a multivalue parameter and i am gettting saying the procedure has more arguements than required. 
0
Peter
Telerik team
answered on 11 Sep 2012, 02:00 PM
Hello,

The DataSource Components do not support MultiValue Report Parameter for Stored Procedures because it is based on ADO.NET and does not allow you to pass a collection of values (set, array). The SqlDataSource component supports parametrized SQL queries by associating the parameters you add to the Parameters collection with placeholders in the SelectCommand query. Parameter values can be evaluated with any expression which conforms to the common expression syntax supported by the reporting engine. This grants you a great deal of flexibility on how you can supply your SQL queries with parameters. Unfortunately the above approach is not applicable for stored procedures.

As a workaround our suggestion is to set the SqlDataSource parameter to a comma separated string of the values. I have attached a sample report as an example. In order to run it you will need the AdventureWorks database that came with your installation of Telerik Reporting. Additionally you will need GetByProductNames stored procedure:

USE [AdventureWorks]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
    
CREATE PROCEDURE [dbo].[GetByProductNames]
@Names nvarchar(MAX)
AS
BEGIN
        SELECT p.ProductID, p.Name, p.Color FROM Production.Product AS p WHERE CHARINDEX( ',' + p.Name + ',', ',' + @Names + ',' ) > 0
 
END

Regards,
Peter
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

Tags
Report Designer (standalone)
Asked by
Ravi
Top achievements
Rank 1
Answers by
Elian
Telerik team
Ravi
Top achievements
Rank 1
Peter
Telerik team
Share this question
or