Passing multiple values to a parameter in a DataDriven Subscription

  • Hello everybody,

    I have created a report with a multivaluable parameter as many other times. The report works properly.

    To simplify let´s say that the report only have a parameter year and shows as many columns as years selected with the incomes received every year

    Well, now I need to create a Data driven subscription over this report.

    If works when I write static multivalues, but when I try to generate the parameter year with a query to include the last three years I am not able to make the subscription work.

    I probed with a lot of separators and looked for a solution but I don´t find any answer.

    ¿Could you help me?

    Thankyou everybody in advance

  • Have you tried using a split function to pass in multi values?

    CREATE FUNCTION dbo.Split

    (

    @RowData nvarchar(2000),

    @SplitOn nvarchar(5)

    )

    RETURNS @RtnValue table

    (

    Id int identity(1,1),

    Data nvarchar(100)

    )

    AS

    BEGIN

    Declare @Cnt int

    Set @Cnt = 1

    While (Charindex(@SplitOn,@RowData)>0)

    Begin

    Insert Into @RtnValue (data)

    Select

    Data = ltrim(rtrim(Substring(@RowData,1,Charindex(@SplitOn,@RowData)-1)))

    Set @RowData = Substring(@RowData,Charindex(@SplitOn,@RowData)+1,len(@RowData))

    Set @Cnt = @Cnt + 1

    End

    Insert Into @RtnValue (data)

    Select Data = ltrim(rtrim(@RowData))

    Return

    END

  • Hello,

    You can pass the value in the form of a string(Varchar) of various values to be passed. You may seperate the values with a delimiter and then break this string in Stored proc and use those values.

    RAQ Report: Web-based Excel-like Java reporting tool[/url]

  • This has been a problem for me for the past couple of years. I have not found a solution but found a work around. In my case I have Region, Area and District. I want to pass a multi value to District, example: "Orlando, Tampa' but it fails. So I set up a cascading parameters. Region= South and Area= Area 1 (which defaults Districts) to Orlando and Tampa. With the use of cascading parameters and defaults I am able to go one level up to get multi below.

    In your case you mentioned multiple years. I know it sounds crazy but you could setup a hidden parameter that defaults the multi value for you. Example: Multi Year = "2009/10" which with default & split int functions you can display 2009 & 2010 selected.

    I even took it a step further and had a "IsSub" parameter. This allows me to bypass some parameters or dynamically control some of the parameter datasources to use split int or not. This is primarliy used when the report is executed in the portal vs subscription.

    To answer you question of passing a '2009,2010' to reporting services in a data driven subscription, It is not possible. But you can control the the default values.

    If you set the report to default to all, and used a "IsSub' parameter you can change the avaliable values to only the one you want, in this case 2009 and 2010. By controlling the default instead of trying to pass multi values you accomplish the samething.

    Good luck, I hope this helps

    http://fsugeiger.blogspot.com/

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply