2

我需要将此查询放入 SSRS 报告中。

SELECT  s.SR_Service_RecID    -- will have 1 result
     ,  p.Description         -- will have 8 results 
     ,  t.notes               -- will have 5 results

FROM SR_Service s
     LEFT JOIN IV_Product p
            ON p.SR_Service_RecID = s.SR_Service_RecID
     LEFT JOIN Time_Entry t
            ON t.SR_Service_RecID = s.SR_Service_RecID

此查询将 p.Description 乘以 t.Notes 以获得预期的总行数。

结果集:

SR_RecID    Description    Notes
12345       Product 1      Note 1
12345       Product 1      Note 2
12345       Product 1      Note 3
12345       Product 1      Note 4
12345       Product 1      Note 5
12345       Product 2      Note 1
12345       Product 2      Note 2
12345       Product 2      Note 3
12345       Product 2      Note 4
12345       Product 2      Note 5
Etc..

如何将其放入 SSRS 报告中,使其仅显示实际结果,而不是相乘的金额?

SR_RecID
12345

Description
Product 1
Product 2
Product 3
Product 4
Product 5
Product 6
Product 7
Product 8

Notes 1
Notes 2
Notes 3
Notes 4
Notes 5

我是否需要重新处理查询,或者这可以在 SSRS 结束时完成吗?

4

1 回答 1

2

是的,您可以通过添加 tablix 来实现:

图像1

并使用 3 个相邻组(按每个字段分组),如下所示:

图2

你会得到这样的结果:

图3

于 2013-04-16T10:05:10.297 回答