#ProjectServer #SSRS Report with multivalued parameters #SQL #PS2010 #SP2010
I am a Project Server and SharePoint consultant but my main focus currently is around Project Server.
I have been working with Project Server for nearly five years since 2007 for a Microsoft Gold Certified Partner in the UK, I have also been awared with the Microsoft Community Contributor Award 2011. I am also a certified Prince2 Practitioner. This article has been cross posted from pwmather.wordpress.com (original article) |
A quick blog post to highlight the use of one of the Project Server Reporting database functions to resolve an issue when using an SSRS multi value parameter.
There are several methods to get multi value parameters working in SQL Server Reporting Services (SSRS) including dataset filters, joining parameters and custom SQL functions – other blogs / forum posts detail these. This post demonstrates using a function that is available in the Project Server Reporting database. The function is called MSP_FN_Utility_ConvertStringListToTable. An example SQL Stored Procedure that will allow multi values can be seen below:
CREATE PROCEDURE [dbo].[SP_ProjectData] (
@ProjUID NVARCHAR (max)
)AS
BEGIN
select P.ProjectName
, T.TaskName
from MSP_EPMProject_UserView P
INNER JOIN MSP_EPMTask_UserView T
ON P.ProjectUID = T.ProjectUID
INNER JOIN MSP_FN_Utility_ConvertStringListToTable (@ProjUID) AS PU
On P.ProjectUID IS NULL or P.ProjectUID like PU.TokenVal
END
Create the SQL query as normal but instead of using a where clause to filter the Project UIDs join on to the function as shown above.