Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Passing multiple values to a parameter in a DataDriven Subscription


Passing multiple values to a parameter in a DataDriven Subscription

Author
Message
LFC
LFC
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 89
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
Devin Knight
Devin Knight
Grasshopper
Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)

Group: General Forum Members
Points: 17 Visits: 223
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
becklery
becklery
SSC-Enthusiastic
SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)

Group: General Forum Members
Points: 143 Visits: 187
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
bgeige
bgeige
SSC Rookie
SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)SSC Rookie (37 reputation)

Group: General Forum Members
Points: 37 Visits: 392
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/
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search