SQL Reporting Services - 子报表分为多个列
我从某人那里继承了一个 SQL Reporting Services .rdl 项目,需要帮助修复某些功能。 在报表的每一行中,都有一个子报表。为了节省空间,子报表被分为 3 个。这样,在报表的每一行中,它将子报表的数据分成 3 个较小的表。现在,它水平填充这 3 个子报表。 (即,如果结果有 9 个值,第一个子表将有 1、4 和 7,第二个子表将有 2、5 和 8,等等) 有没有办法让它垂直填充子表? (即第一个子表有 1,2 和 3)
谢谢!
I inherited an SQL Reporting Services .rdl project from somebody and need help fixing some functionality.
In each row of the report, there is a subreport. In order to save space the subreport is divided into 3. Such that in each row of the report, it splits the data of the subreport into 3 smaller tables. Right now, it fills these 3 subreports horizontally. (ie. if the result has 9 values, the first subtable will have 1, 4 & 7, the second subtable will have 2, 5 & 8, etc)
Is there a way to have it fill the subtables vertically? (ie. the first subtable would have 1,2 & 3)
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
默认情况下,多列报告应垂直填充。事实上,甚至没有水平填充的选项,所以我想知道它是如何完成的。也许底层查询已被修改?
By default, the multi-column reports should fill vertically. In fact, there isnt even an option to fill horizontally so i'd like to know how it is being done. Perhaps the underlying query has been modified?
事实上,我更深入地研究了该查询,结果发现列号作为报告参数传递,并且使用列号的模对结果进行重新排序。我现在没有它,所以我不知道确切的语法。
In fact, I took a deeper look into the query and it turns out that the column number is being passed as a report parameter and the results are being reordered using a modulo on the column number. I don't have it with me right now, so I don't have the exact syntax.
任何尝试执行此操作的人的更多信息:
事实证明,子报表查询生成了一个指示行号的列
ROW_NUMBER() OVER (PARTITION BY columnName ORDER BY otherColumn) AS RowNumber
然后在报表中,子报表被包含了 3 次。每个子报表都有一个名为 Column 的报表参数,第一个值为 1,第二个为 2,最后一个为 0。子报表上有一个过滤器
=RowNumber Mod 3 = Column,
这样子报表结果将分为 3 个支持报表可以全部放在同一行以节省空间。
More info for anyone trying to do this:
it turns out that the subreport query gerates a column which indicates the row number
ROW_NUMBER() OVER (PARTITION BY columnName ORDER BY otherColumn) AS RowNumber
Then in the report, the subreport is included 3 times. Each subreport has a report parameter called Column, the first one is of value 1, the second 2 and the last one 0. The subreport then has a filter on it
=RowNumber Mod 3 = Column
that way the subreport results are divided into 3 supreports that can all be placed on the same row to save space.