Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 ssrs 2008 r2 parameters

Author  Topic 

jassie
Constraint Violating Yak Guru

332 Posts

Posted - 2013-12-20 : 09:57:51
In an existing SSRS 2008 R2 report, I need to add some extra parameters to several reports that call subreports. There will be times when the parameters may be empty. The visibility of specific columns and report headers will determine if the column or report header will be displayed. If the parameter(s) are empty, null, do not contain anything, I want those columns and report headerts to not display.

Can you show me the code that will test to see if a parameter value is null?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-12-21 : 01:34:41
Didnt i give you solution here?
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/e70312b9-606a-4f7c-9b62-82bf7ad99151/ssrs-2008-r2-parameters?forum=sqlreportingservices#c04da0f3-ac80-44c0-801c-85ee54edd974

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

cbrammer1219
Starting Member

3 Posts

Posted - 2013-12-22 : 13:50:15
Hi I have tried using the mv_param function and the fn_split function, When I use them it returns everything from that column, my example follows...When executed it returns everything like it is ignoring the function, @Country prints out the right values as set in the param, but the results are 'USA,IRL,AUS,NZL,CAN,JPN' I am at a loss because the function isn't working so it seems. The function code follows the select code....Any help or advise is greatly appreciated.

>DECLARE @currYr nvarchar(4)
DECLARE @gblCliName nvarchar(65)
DECLARE @Country nvarchar(75)

SET @currYr ='2013'
SET @gblCliName ='Jimmy'
SET @Country ='CAN,AUS,IRL'


SELECT
MONTH_CODE
,AON_COUNTRY
,GLOBAL_CLIENT_NAME
,GLOBAL_CLIENT_DUNS_NUMBER
,LOCAL_CLIENT_CODE
,LOCAL_CLIENT_NAME
FROM AIMS_UDE_POLICY_ROLLUP
WHERE
GLOBAL_CLIENT_NAME LIKE @gblCliName + '%'
AND SUBSTRING(MONTH_CODE, 1, 4) = @currYr AND AON_COUNTRY IN (select AON_COUNTRY from dbo.fnSplit(@Country,',')as string)


---------Function
ALTER FUNCTION [dbo].[fnSplit]
( @string nvarchar(4000)
, @delim nvarchar(100) )
RETURNS
@result TABLE
( [Value] nvarchar(4000) NOT NULL
, [Index] int NOT NULL )
AS
BEGIN
DECLARE @str nvarchar(4000)
, @pos int
, @prv int = 1

SELECT @pos = CHARINDEX(@delim, @string)
WHILE @pos > 0
BEGIN
SELECT @str = SUBSTRING(@string, @prv, @pos - @prv)
INSERT INTO @result SELECT @str, @prv

SELECT @prv = @pos + LEN(@delim)
, @pos = CHARINDEX(@delim, @string, @pos + 1)
END

INSERT INTO @result SELECT SUBSTRING(@string, @prv, 4000), @prv
RETURN
END
Go to Top of Page
   

- Advertisement -