SSRS报告分页问题
我在 SSRS 报告中遇到分页符问题,而且我绝不是专家。这是在 XML 标记中提供分页符:
<TableGroups>
<TableGroup>
<Grouping Name="AdjustmentPageBreakGroup">
<PageBreakAtEnd>true</PageBreakAtEnd>
<GroupExpressions>
<GroupExpression>=CInt(Ceiling(RowNumber(Nothing)/28))</GroupExpression>
</GroupExpressions>
</Grouping>
</TableGroup>
</TableGroups>
分页符出现在报告的打印和屏幕版本上的不同行上:
打印:
屏幕:
正如您所看到的,打印版本的“Transfer IN”单元格中间有一个中断,中断后的下一页上有“Value”。从 XML 中可以看出,它在第 28 行有一个硬编码的分页符,如果我更改此数字,它会修复打印版本并破坏屏幕版本。有没有办法为打印和屏幕指定不同的换行符?
I have a problem with page breaks in an SSRS report, and I'm by no means an expert. This is in the XML mark up to provide a page break:
<TableGroups>
<TableGroup>
<Grouping Name="AdjustmentPageBreakGroup">
<PageBreakAtEnd>true</PageBreakAtEnd>
<GroupExpressions>
<GroupExpression>=CInt(Ceiling(RowNumber(Nothing)/28))</GroupExpression>
</GroupExpressions>
</Grouping>
</TableGroup>
</TableGroups>
The page break appears on different lines on the print and screen version of the report:
Print:
Screen:
As you can see, the print version has a break in the middle of the "Transfer IN" cell, with "Value" on the next page after the break. From what I can tell from the XML, it's got a hardcoded page break at row 28, and if I change this number it fixes the print version and breaks the screen version. Is there any way to specify this line break differently for print and screen?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
解决这个问题的方法是使用矩形组件。根据您的图像,我假设您的报告有一个按位置分组的表格。对于每个位置,您要报告数量和价值。第 1 列具有位置名称,第 2 列是标签,第 3 列是字段值。
创建一个新表(表 A)。将表设置为按位置分组。在组页脚中,添加一个矩形 (RECTANGLE)。将矩形的“保持内容在一起”属性设置为 TRUE。
将表格添加到矩形区域(表 B)。不要向表 B 添加分组。向该表的详细信息行添加列 1、列 2 和列 3,其格式与现有报告中的格式相同。
当报表呈现时,每个组将保持在一起,并且矩形将强制在分组之间进行分页。
上面的解决方案适用于 SSRS 2008。下面的解决方案类似,适用于 SSRS 2005。
创建一个新表(表 A)。将表设置为按位置分组。在组页眉或页脚中添加一个表格(表 B)。不要向表 B 添加分组。向该表的详细信息行添加列 1、列 2 和列 3,其格式与现有报告中的格式相同。在 TABLE B 上,如果可能,请使用 Fir table on one page 选项。
The solution to this issue is the rectangle component. Based on your image, I am assuming that your report has a table that is grouped on location. For each location you are reporting on Number and Value. Column 1 has the location name, Column 2 is the label and Column 3 is the field values.
Create a new table (TABLE A). Set the table to group on Location. In the group footer, add a rectangle (RECTANGLE). Set the Keep Contents Together property of the rectangle to TRUE.
Add a table to the area of the rectangle (TABLE B). Do not add a grouping to TABLE B. Add to the details row of this table Column 1, Column 2, and Column 3 formatted as it is in the existing report.
When the report renders, each group will be kept together and the rectangle will force page breaks between the groupings.
The solution above works for SSRS 2008. The solution below is similar and works for SSRS 2005.
Create a new table (TABLE A). Set the table to group on Location. In the group header or footer add a table (TABLE B). Do not add a grouping to TABLE B. Add to the details row of this table Column 1, Column 2, and Column 3 formatted as it is in the existing report. On the TABLE B use the Fir table on one page if possible option.
您可以通过几个小步骤来解决此问题:
1-转到报告属性并将纸张尺寸设置为自定义。宽度和长度应如此,它将显示所有列:
2- 然后设置 Body 属性,如下所示:
现在查看报告并以任何 PDF/任何不会损坏的格式下载:
You can solve this problem by using few small steps:
1-Go to report properties and set paper size to custom. The width and length is to be as such, that it will show all column :
2- Then set the Body Property like same :
Now View the report and download in any PDF/Any format it will not break:
确保交互尺寸和页面尺寸相同。您还必须设置页边距,以便打印版本能够正确打印。
Make sure the interactive size and the page size are the same. You also have to set the margins so that the print version prints properly.