Question : Filtering the SSRS report based on multivalue multiple parameters passed to stored procedure

I have four filter on a report BU, Reviewer Name, Approver Name, Approver status are four multivalue dropdown that should be present as report parameters  in reporting services. i have 4 datasets that list all the values for the four columns and a stored procedure where the parameters are passed. the question is how can i design the stored procedure so i am able to filter the multivalue parameters independent of each other basically i need help with the stored prcoedure so i can pass in values as report parameters to this stored procedure and search independently, currenlty i can filter by business unit., other search condition based on Or does not seem to work what will be the approach for writing multi value input parameters sp in this case.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
ALTER PROCEDURE [dbo].[RptHourly_ApproverStatus] 

@BU varchar(10) = NULL ,
@Reviewer Varchar(60) = NULL, 
@Approver Varchar(60) = NULL, 
@perf_status varchar(30) =NULL , 
@Approval_Status varchar(40)=NULL
	-- Add the parameters for the stored procedure here

AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
SELECT     dbo.ADP_Feed_0318.NodeID, dbo.ADP_Feed_0318.FirstName + ' ' + dbo.ADP_Feed_0318.LastName AS Employee, 
                      ADP_Feed_0318_1.FirstName + ' ' + ADP_Feed_0318_1.LastName AS Reviewer, 
                    CASE 
                     WHEN (ADP_Feed_0318.Perf_Status = 2)THEN 'In Progress' 
                     WHEN (ADP_Feed_0318.Perf_Status = 3) THEN 'Complete' 
                     WHEN (ADP_Feed_0318.Perf_Status IS NULL) 
                      THEN 'Not Started' ELSE 'Not Started' END Perf_Status,
 
                      ADP_Feed_0318_2.FirstName + ' ' + ADP_Feed_0318_2.LastName AS Approver, 

                
                  CASE 
                     WHEN (ADP_Feed_0318.Approval_Status = 2)THEN 'In Progress' 
                     WHEN (ADP_Feed_0318.Approval_Status = 3) THEN 'Complete' 
                     WHEN (ADP_Feed_0318.Approval_Status IS NULL) 
                      THEN 'Not Started' ELSE 'Not Started' END Approval_Status,

                     dbo.ADP_Feed_0318.BU, 
                     CONVERT(FLOAT,dbo.ADP_Feed_0318.Perf_Average) AS [CalculatedRating], 
                     dbo.ADP_Feed_0318.Manager_Average AS [Overall Rating] 
FROM         dbo.ADP_Feed_0318
             INNER JOIN
                      dbo.ADP_Feed_0318 AS ADP_Feed_0318_1 
                ON dbo.ADP_Feed_0318.MgrNodeID = ADP_Feed_0318_1.NodeID
           INNER JOIN
               dbo.ADP_Feed_0318 AS ADP_Feed_0318_2 
                 ON ADP_Feed_0318_1.MgrNodeID = ADP_Feed_0318_2.NodeID


WHERE     (dbo.ADP_Feed_0318.TYPE ='0')

AND (ADP_FEED_0318.BU= @BU )     
 OR (ADP_Feed_0318_2.FirstName + ' ' + ADP_Feed_0318_2.LastName  = @Approver) --
OR (ADP_Feed_0318_1.FirstName + ' ' + ADP_Feed_0318_1.LastName =  @Reviewer)OR (ADP_FEED_0318.Approval_Status = @Approval_status )

Answer : Filtering the SSRS report based on multivalue multiple parameters passed to stored procedure

You can use the test for null to ignore whatever parameter was not set, i.e. no filter on.

AND (@BU is null or ADP_FEED_0318.BU= @BU)  --- BU.  if it is null, it passes the check, otherwise must match filter
AND (@Approver is null or ADP_Feed_0318_2.FirstName + ' ' + ADP_Feed_0318_2.LastName  = @Approver)

.. etc
Random Solutions  
 
programming4us programming4us