SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 ssrs 2008 r2 parameters
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jassie
Constraint Violating Yak Guru

308 Posts

Posted - 12/20/2013 :  09:57:51  Show Profile  Reply with Quote
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

India
52317 Posts

Posted - 12/21/2013 :  01:34:41  Show Profile  Reply with Quote
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

1 Posts

Posted - 12/22/2013 :  13:50:15  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000