【SSRS报表】按行数进行分组打印
来源:互联网 发布:还处于叛逆期 知乎 编辑:程序博客网 时间:2024/06/06 03:05
Recently we had a requirement to reduce the height of an SSRS report which was being rendered in SharePoint’s Report Viewer. When the interactive size property did not have any effect at all, which is still a mystery to me, we decided on a different approach. The solution we opted to use was to limit the report records displayed to 50 rows per page, which involves using the Ceiling function in SQL Server Reporting Services.
The following discussion presumes that the report has been developed & all that's left is handling the pagination.
First, add a Row Group which is a Parent of the existing top level group. In the Group By expression, enter =CEILING(RowNumber(Nothing)/50)where 50 is the number of records to be displayed per page. Be sure to leave the group header & footer boxes unchecked. Since this group’s only purpose will be to force page breaks, we won’t be taking up any real estate on the report.
Ceiling function: Returns the first whole number equal to or higher than its argument.
RowNumber function: Performs a running count of rows within a specified scope. The keyword controls the scope of where the counting begins. By using Nothing, it will utilize the outermost data region (in this example, I only have one tablix data region). You may also replace the Nothing keyword with the name of a specific data region or group (within quotes). A discussion of RowNumber can be foundhere.
Next, right-click the group just created and go to its Group Properties. Give the group a useful name (because Group1 is certainly not a descriptive name in my humble opinion). Use whatever makes sense to you or, perhaps more importantly, what would make sense to the next person who is trying to understand the report definition. I like to use naming conventions to be self-documenting as possible.
On the Page Breaks section of Group Properties, check “Between each instance of a group.” Don’t choose to break at the start or end of a group or you could end up with an extra blank page.
Next, go to the Sorting section of Group Properties. You’ll most likely just want to remove the sorting because it's handled elsewhere. When you created the group, SSRS automatically created sorting to be the same as your Group By expression. While this is usually a nice convenience, in this case it’ll cause an error the first time you run the report if you don't remove it.
The Row Groups pane will now look similar to the following:
Lastly, delete the first column in the tablix that SSRS created for us automatically when the group was created. In order to enforce page breaks using this group, we don’t need to actually display anything on the report. Choose the 2nd radio button to “Delete columns only” which preserves the group itself which contains the Ceiling function.
文章出处:http://www.sqlchick.com/entries/2010/9/11/displaying-fixed-number-of-rows-per-ssrs-report-page.html
- 【SSRS报表】按行数进行分组打印
- SSRS 指定数据行数进行换页
- grid report分组打印报表
- 【SSRS报表】创建第一个SSRS报表
- SSRS报表开发
- ssrs 报表固定设置
- SSRS报表参数
- SSRS 2008 明细报表
- Report报表对数据进行分组显示
- 条形码生成打印控件SSRS报表版Barcode Professional for Reporting Services
- AX 2012 SSRS 报表发布
- 4.4、SSRS-报表的发布
- SSRS报表实现交互式排序
- SSRS 报表日志查看器
- 4.9、SSRS-钻取报表
- SQL多行数据按分组合并
- 用 Delphi 实现报表的横向分组打印
- 用 Delphi 实现报表的横向分组打印
- man 命令使用小技巧
- win7 64位安装vs2013后连接远程数据库出现下面的问题:
- ESXi5 中查看内置存储器健康状况
- Ubuntu 13.04下安装RabbitVCS整理记录
- 【MySQL】MySQL读写加锁深入分析
- 【SSRS报表】按行数进行分组打印
- 一个字符串中带有双引号,如何取得双引号内的字符串(C#)
- aspx,ascx和ashx使用小结
- Android中的Audio播放:控制Audio输出通道切换
- Android:DialogFragment的使用
- 找出100——200间的全部素数
- GoLang之Concurrency顺序管道模式
- 蜂王浆软胶囊
- 参加广州.NET培训课程后能做什么呢?