Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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
Author
Message
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
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, June 10, 2014 3:12 PM
Points: 16, Visits: 213
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
Post #833329
Posted Thursday, January 14, 2010 9:09 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, January 14, 2010 9:09 AM
Points: 141, 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
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: Monday, November 17, 2014 7:28 AM
Points: 37, Visits: 345
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/
Post #855527
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse