SSRS - 生成大小不动态的报告
我想构建一个大小和形状完全静态的报告。 我正在尝试模仿我的组织中的某人多年来一直根据文字文档构建的手写报告。
关键部分似乎是修复填充页面的各个表格网格中生成的行数。 我希望它们始终包含一定数量的行,无论数据是否存在。 看起来,如果我可以固定表格的大小,那么所有其他元素都不会因为拉伸中继器部分而被迫移动。
我的所有网格都由存储过程支持,因此我也愿意接受 SQL 技巧。
I want to build a report that is completely static in size and shape. I'm attempting to mimic a hand-entered report that someone in my organization has been building from a word doc for years.
The critical piece appears to be fixing the number of rows that are produced in the various Table grids that fill the page. I would like them to always contain a set number of rows, whether data is present or not. It would seem that if I can just fix the size my tables, then all the other elements will not be forced to move because of stretching repeater sections.
All my grids are backed by stored procedures, so I'm open to SQL tricks as well.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这不是直接答案,但也许是您可能考虑的解决方法:也许您可以在具有动态大小的表格网格之后插入分页符,以便其后面的所有元素都有固定位置(相对于页面顶部)。
Not a direct answer, but perhaps a workaround you might consider: perhaps you can insert a page break after the table grids that have dynamic sizes, so that all elements that follow it have a fixed position (relative to the top of the page).
使用 =Ceiling((RowNumber(Nothing)) / 10000) 表达式将父组添加到 tablix。 (10000 或任何需要的行数)
在组的分页符属性中,选中组之间插入分页符的复选框,不要选中底部的框。
或者,我们可以选择为由于新父组而添加的文本框设置隐藏属性 true。
在 tablix 属性中,选中“在一页上保持在一起”复选框。
Add a parent group to tablix with =Ceiling((RowNumber(Nothing)) / 10000) expression. (10000 or whatever is required no. of rows)
In page break properties of group, check box for insert break between groups, leave the bottom boxes un-checked.
Optionally, we may chose to set hidden property true for text boxes added because of new parent group.
In tablix properties, check box for "Keep together on one page".
抱歉,我确实漏读了这个问题。
如果您知道需要返回多少行(例如 20 行),也许您可以将一些虚假信息填充到从存储过程返回的记录中。 在将查询返回的记录发回之前,您可以对它们进行计数,如果少于 20 条,请向记录集中添加一些虚假记录,并在其中添加“NonDisp”之类的内容。
然后在报告中将 iif 语句放入检查此虚假信息的单元格中,如果发现,则更改单元格以不显示任何内容,否则显示有效值
Sorry i did miss-read the question.
If you know how many rows you need to return (say 20) maybe you could pad some bogus info into your records returned from the stored procedure. You might be able to count the records your query has returned before you send them back, and if you have less than 20 add some bogus ones to the record set, put something like 'NonDisp' or something in them.
Then in the report put an iif statement into the cells that checks for this bogus info, if it is found change the cell to display nothing, otherwise show the valid values