【发布时间】:2019-06-15 19:46:30
【问题描述】:
我有一份格式非常具体的报告,但在 SSRS (2016) 中实施时遇到了问题。它应该有一个跨越所有列组的行。这是我在 Word 中制作的一个粗略模型,用于演示所需的布局:
所以基本结构是一个项目列表,每个项目都有一个或多个交易,每个交易都有一组财政年度的资金数额。
我遇到的问题是项目标题可能很长,他们希望它跨越整行。
我能够使用如下矩阵在 SSRS 中实现大部分报告结构:
所以每个项目都有一个父行组,然后每个事务都有一个子行组。会计年度有一个列组,详细信息单元格包含金额。
上述报告的输出如下所示:
所以它大部分是正确的,但项目标题并没有跨越整行。我想做的是将粗体 [ProjectTitle] 单元格与右侧的空单元格合并,但是当我选择两个单元格时,没有合并它们的选项。据我了解,您不能在 SSRS 中跨列组合并单元格?
是否有解决方法来实现所需的结构?
这是我用于上述示例的 SQL 查询:
SELECT * FROM (VALUES
(1, 'Project Title which can be really long', 1, 'Transaction 1', 2019, 2.25),
(1, 'Project Title which can be really long', 1, 'Transaction 1', 2020, 7.25),
(1, 'Project Title which can be really long', 1, 'Transaction 1', 2021, -2.25),
(1, 'Project Title which can be really long', 1, 'Transaction 1', 2022, 0.55),
(1, 'Project Title which can be really long', 1, 'Transaction 1', 2023, 6.25),
(1, 'Project Title which can be really long', 1, 'Transaction 1', 2024, 4.5),
(1, 'Project Title which can be really long', 1, 'Transaction 1', 2025, 1.25),
(1, 'Project Title which can be really long', 1, 'Transaction 1', 2026, 1.5),
(1, 'Project Title which can be really long', 2, 'Transaction 2', 2019, 1.75),
(1, 'Project Title which can be really long', 2, 'Transaction 2', 2022, 2.25),
(1, 'Project Title which can be really long', 2, 'Transaction 2', 2024, 0.75),
(1, 'Project Title which can be really long', 2, 'Transaction 2', 2025, 2.55),
(1, 'Project Title which can be really long', 2, 'Transaction 2', 2026, 1.5),
(1, 'Project Title which can be really long', 3, 'Transaction 3', 2020, 2.35),
(1, 'Project Title which can be really long', 3, 'Transaction 3', 2021, 11.5),
(1, 'Project Title which can be really long', 3, 'Transaction 3', 2022, -0.55),
(1, 'Project Title which can be really long', 3, 'Transaction 3', 2023, -0.75),
(1, 'Project Title which can be really long', 3, 'Transaction 3', 2024, 1.05),
(2, 'Another Project', 1, 'Transaction 1', 2019, 2.86),
(2, 'Another Project', 1, 'Transaction 1', 2020, 1.25),
(2, 'Another Project', 1, 'Transaction 1', 2021, 0.75),
(2, 'Another Project', 1, 'Transaction 1', 2022, -0.55),
(2, 'Another Project', 1, 'Transaction 1', 2023, 2.05),
(2, 'Another Project', 1, 'Transaction 1', 2024, -3.28),
(2, 'Another Project', 1, 'Transaction 1', 2025, 0.75),
(2, 'Another Project', 1, 'Transaction 1', 2026, -0.5),
(2, 'Another Project', 2, 'Transaction 2', 2019, 0.25),
(2, 'Another Project', 2, 'Transaction 2', 2022, 1.25),
(2, 'Another Project', 2, 'Transaction 2', 2024, 2.25),
(2, 'Another Project', 2, 'Transaction 2', 2025, -1.55),
(2, 'Another Project', 2, 'Transaction 2', 2026, 2.5)
) AS Funding(ProjectId, ProjectTitle, TransactionId, TransactionTitle, FiscalYear, Amount);
【问题讨论】: