SSRS报告使用预过滤

时间:2013-04-19 16:57:19

标签: ssrs-2008 reporting-services

我想针对与客户合同相关的每个案例运行我的报告。现在我可以在帐户级别上运行报告。我使用过滤视图如下:

dbo.FilteredAccount AS CRMAF_FilteredAccount 
on CRMAF_FilteredAccount.accountid = I.CustomerId 
WHERE A.PartyObjectTypeCode = 8 AND A.PartyIdName IS NOT NULL

我希望能够针对与合同关联的帐户的每个案例运行相同的报告。我尝试使用FilteredIncident视图,但我不确定我做得对。

从评论中查询:

SELECT I.CustomerIdName AS 'Customer Name',
       S.CreatedOn AS 'Task Start Date',
       S.Subject AS 'Task Performed',
       A.PartyIdName AS 'Resource',
       S.Description,
       cast((S.ActualDurationMinutes / 480) as varchar(5)) +' day(s)' + ', ' +
           cast((S.ActualDurationMinutes% 480) / 60 as varchar(2))+' hour(s)' 
           as 'Time Spent',
       S.ActualDurationMinutes AS 'Total Time',
       S.ActualDurationMinutes AS 'Total' 
FROM dbo.Incident I 
JOIN [dbo].[ServiceAppointment] S ON I.IncidentId = S.RegardingObjectId 
JOIN dbo.ActivityParty A ON S.ActivityId = A.ActivityId

1 个答案:

答案 0 :(得分:1)

您需要在选择列表中添加CaseID,并在报告中将参数与其进行比较。所以你要在你的WHERE子句中添加这样的东西:

WHERE I.CaseID = @SelectedCase