在SSRS 2008中重复行号

时间:2014-01-21 15:35:06

标签: sql reporting-services ssrs-2008

试图获取一个报告来显示行计数的单一内容,我终于开始工作了(为什么RowCount比它需要的更复杂?)这让我想到了下一点,它显示了行数行显示的次数!

enter image description here

这是我使用的公式: enter image description here

SQL for this:

select distinct
    [File Number] = fm.FileNumber,
    [Client] = pc.Name, --Join FPR & PartnerType (PartnerTypeID = 1)
    [Abstractor] = pc1.Name, --PTID = 12
    p.State,
    [Title Order Date] = CONVERT(VARCHAR,fm.OpenedDate,1),
    [Title received date] = CONVERT(VARCHAR,fm.OpenedDate,1),
    [Date Title search order placed] = CONVERT(VARCHAR,fa.SentDate,1), --ADID = 18
    [ETA to title order search received] = DateAdd(day,3,fa.SentDate),
    [Actual received date] = CONVERT(VARCHAR,fa1.ReceivedDate,1),  --ADID = 19
    [Examination Date] = CONVERT(VARCHAR,fa2.SentDate,1),  --ADID = 654
    [Examiner] = IU.Firstname + ' ' + IU.LastName,  
    [Commitment Date] = CONVERT(VARCHAR,sd.CommitmentEffDate,1),
    [Final product to client] = CONVERT(VARCHAR,fa3.ReceivedDate,1)  --ADID = 799   
    ,pc.PartnerCompanyID as 'Client ID', pc1.PartnerCompanyID as 'Abstractor ID', InternalUserID
from FileMain fm
join FilePartnerRel fpr on fpr.FileID = fm.FileID AND fpr.PartnerTypeID = 1
join FilePartnerRel fpr1 on fpr1.FileID = fm.FileID AND fpr1.PartnerTypeID = 12
join PartnerCompany pc on pc.PartnerCompanyID = fpr.PartnerCompanyID
join PartnerCompany pc1 on pc1.PartnerCompanyID = fpr1.PartnerCompanyID
join FileActions fa on fa.FileID = fm.FileID and fa.ActionDefID = 18
left join FileActions fa1 on fa1.FileID = fm.FileID and fa1.ActionDefID = 19
left join FileActions fa2 on fa2.FileID = fm.FileID and fa2.ActionDefID = 654
left join FileActions fa3 on fa3.FileID = fm.FileID and fa3.ActionDefID = 799
join SearchData sd on sd.FileID = fm.FileID
left join InternalUser iu on iu.InternalUserID = fa2.SentUserID
join property p on p.FileID = fm.FileID
Where
fm.OpenedDate between @StartDate and @EndDate

我要做的是让“total”仅报告计算行的1个实例,如下所示: enter image description here

2 个答案:

答案 0 :(得分:1)

您需要添加一个组,或者如果该组已经存在于您的表中,那么您需要将该列添加到您的组中,而不是添加到详细信息组。

尝试右键单击包含用于该组的字段的列,然后选择“插入列 - >”内部组 - 右键“将countrows()表达式放在结果单元格中。

分组和包括不同组中的列或行的不同方式对于构建稍微复杂的报告至关重要。如果您要使用SSRS,那么值得学习这些。 Google SSRS Groups提供了许多链接和教程,例如Technet reference.

答案 1 :(得分:0)

你要完成的是什么并不是很清楚但是你能用SQL来获得你需要的数量吗? (即从SQL语句中返回“记录计数”列并在报告中使用它)