Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Passing multiple values to a parameter in a DataDriven Subscription Expand / Collapse
Posted Tuesday, October 6, 2009 3:54 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, February 12, 2013 8:38 AM
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
Post #798397
Posted Saturday, December 12, 2009 8:04 AM



Group: General Forum Members
Last Login: Wednesday, November 9, 2016 7:20 AM
Points: 17, Visits: 223
Have you tried using a split function to pass in multi values?

@RowData nvarchar(2000),
@SplitOn nvarchar(5)
RETURNS @RtnValue table
Id int identity(1,1),
Data nvarchar(100)
Declare @Cnt int
Set @Cnt = 1

While (Charindex(@SplitOn,@RowData)>0)
Insert Into @RtnValue (data)
Data = ltrim(rtrim(Substring(@RowData,1,Charindex(@SplitOn,@RowData)-1)))

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

Insert Into @RtnValue (data)
Select Data = ltrim(rtrim(@RowData))

Post #833329
Posted Thursday, January 14, 2010 9:09 AM


Group: General Forum Members
Last Login: Thursday, January 14, 2010 9:09 AM
Points: 141, Visits: 187

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
Post #847647
Posted Thursday, January 28, 2010 11:39 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, February 19, 2016 8:49 AM
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
Post #855527
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse