Error message passing Multivalue

4 posts, 0 answers
  1. Ravi
    Ravi avatar
    3 posts
    Member since:
    Aug 2012

    Posted 03 Sep 2012 Link to this post

    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
  2. Elian
    Admin
    Elian avatar
    435 posts

    Posted 06 Sep 2012 Link to this post

    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 >

  3. DevCraft banner
  4. Ravi
    Ravi avatar
    3 posts
    Member since:
    Aug 2012

    Posted 06 Sep 2012 Link to this post

    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. 
  5. Peter
    Admin
    Peter avatar
    1611 posts

    Posted 11 Sep 2012 Link to this post

    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 >

Back to Top