Quantcast
Channel: Welcome To TechBrothersIT
Viewing all articles
Browse latest Browse all 1933

How to Pass Multi-Value Parameters to Data Driven Subscription in SSRS - Solved - SSRS Tips

$
0
0

How to pass multi-value parameters to DDS (data driven subscription). SSRS – Passing multiple value parameters in data driven subscriptions video show you how you can pass the multiple values to parameter in data Drive subscription in SQL server reporting Services. There is no straight forward way to handle that so I have used dynamic SQL and then use concatenated values for dataset of Data Drive Subscription.


Sample Stored Procedure for Data Driven Subscription example:

USE [TechBrothersIT] GOSET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOALTERProcedure [dbo].[sp_TotalSale] @Region VARCHAR(500), @Country Varchar(500) ASBEGINDeclare @var_Country VARCHAR(500) SET @var_Country = Replace(@Country, ',', ''',''') --print @var_CountryDeclare @SQLNVARCHAR(MAX) SET @SQL = ' Select [SalePersonFName], [SalePersonLName], [ProductName], [ItemsSold], [SoldPrice], [SoldDate], [City], [State], [Country], [Region] from dbo.TotalSale Where Region = '''+@Region+''' And Country in ( '''+@var_Country+''' ) '--Print @SQLExecute( @SQL ) END



Query for Data Driven Subscription DataSet:

SELECT Region, Region as Filename, stuff( ( SELECTdistinct',' + [Country] FROM dbo.TotalSale WHERE Region = t.Region FORXMLPATH('') ), 1, 1, '') as Country FROM ( SELECTDISTINCT Region FROM dbo.TotalSale ) t


SSRS Data Driven Subscription Multi Value Parameters



Viewing all articles
Browse latest Browse all 1933

Trending Articles