子报表尝试并保持在一起,留下空白点/页面

发布于 2024-07-15 01:56:52 字数 660 浏览 8 评论 0原文

Reporting Services 2005

我的布局是这样的:

  • 我的主报表包含一个表
  • 该表有 3 个组运行,GrpLevel1、GrpLevel2、GrpLevel3
  • 子报表添加到 3 个组之一,并且是执行将该组密钥传递给子报告

因此,特定的子报告将在 GrpLevel1 运行,并且对于它包含的每个 level2,GrpLevel2 下的子报告将运行。

我遇到的问题是子报告想要跳到下一页,在报告中留下空白的空白。

如果子报表包含一个包含大量数据的表格,并且无法容纳页面的 3/4(报表第一页的报表标题位于顶部 1/4),它将把整个内容跳到下一页只留下标题,而不是在第一页上打印它可以打印的内容。

我在桌子上关闭了“保持在一起”功能。

我不知所措,准备点燃我的立方体。 对此的洞察力将不胜感激。

更新 ****************这已在 SSRS 2008 R2 中修复******************** *****
(SQL Server) Reporting Services 2008 R2 已修复此问题。 您现在可以在子报告上切换 KeepTogether。 分页看起来好多了。

Reporting Services 2005

My layout is like this:

  • I have the mainreport which contains a table
  • This table has 3 groups it runs by, GrpLevel1, GrpLevel2, GrpLevel3
  • Sub-Reports are added to one of 3 groups and are executed passing that group key to the sub-report

So, a particular sub-report will run at GrpLevel1 and for every level2 it contains, the sub-reports under GrpLevel2 will run.

The problems I'm having are that the sub-reports want to jump to the next page leaving a gapping hole of white-space in the report.

If a sub-report contains a table with a bunch of data and it can not fit on 3/4s of a page (first page on report has report header on top 1/4), it will jump the whole thing to the next page leaving only a header, rather than printing what it can on the first page.

On the table I have "Keep Together" turned off.

I'm at a loss and about ready to set my cube on fire. Insight in to this would be greatly appreciated.

UPDATE ****************THIS HAS BEEN FIXED IN SSRS 2008 R2***********************

It has been fixed with (SQL Server) Reporting Services 2008 R2. You can now toggle the KeepTogether on Sub-Reports. Pagination looks a lot better.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

翻身的咸鱼 2024-07-22 01:56:52

看来这个问题没有解决办法。 该错误已被微软承认,但在 SSRS2008 中仍未修复。

来自知识库文章 (http://support.microsoft.com/kb/938943)

出现此行为的原因是
子报表控件有一个隐式的
KeepTogether 属性。 根据设计,
KeepTogether 属性试图保持
一页上子报表的内容。
由于这种行为,报告
引擎在主屏幕上创建空白区域
如果子报表不适合则报告
与主要报告在同一页上。
然后,报表引擎创建
新页面上的子报表。

他们列出的解决办法本质上是“不要使用子报表”

Looks like there is no solution to this problem. The bug is aknowleged by microsoft, but its still not fixed in SSRS2008.

From the KB article (http://support.microsoft.com/kb/938943)

This behavior occurs because the
Subreport control has an implicit
KeepTogether property. By design, the
KeepTogether property tries to keep
content of a subreport on one page.
Because of this behavior, the report
engine creates blank space on the main
report if the subreport does not fit
on the same page as the main report.
Then, the report engine creates the
subreport on a new page.

The work around that they list is essentially 'don't use subreports'

千秋岁 2024-07-22 01:56:52

我不确定 SSRS 的早期版本,但我在 SSRS 2008 中遇到了同样的问题。

解决方案是更改代码中的 Subreport 属性。

  1. 转到解决方案资源管理器,右键单击您的报告,然后单击“查看代码”。

    转到解决方案资源管理器

  2. 搜索您的子报表。

  3. 在子报表标签内,您会发现“”,该值将设置为“true”,将其更改为“false”

设计器无法提供此属性,必须从实际的报表 xml 代码中进行更改。

I am not sure about the earlier version of SSRS, but I faced this same issue in SSRS 2008.

The solution is to change the Subreport property in Code.

  1. Go to the solution explorer, right click on your report and click on "View Code".

  2. Search for your Subreport.

  3. Inside subreport tag you'll find "<KeepTogether>", which would be set to "true", change it to "false"

This property is not avaiable from designer and has to be changed from the actual report xml code.

夜访吸血鬼 2024-07-22 01:56:52

右键单击子报表并选择格式子报表,然后取消选中将对象保持在一起

right click of subreport and chose format subreport, then uncheck keep object together

中二柚 2024-07-22 01:56:52

我解决这个问题的另一种方法是将子报表放在报表标题中。 当然,这非常依赖于报告内容,并且消除了后续部分的任何用处,但它确实解决了我在第一页上有大量空白的问题。

Another way I got around this was to place the subreport in the report header. Of course that is very dependent on the report content and elminates any of the usefulness of subsequent sections but it did solve my problem of having a huge chunk of whitespace on the first page.

不…忘初心 2024-07-22 01:56:52

我花了一周的时间才解决这个问题! 但我确实找到了解决方案并很高兴与您分享。

我有同样的问题。 在我的主报告中,有一个表,其中有 3 个组,每组中有 2 个不同的子报告。 这些子报表有矩阵。 我相信,无论矩阵如何,将子报表放置在表格内的组/详细信息带内会导致在各部分之前、之间和之后打印大量不必要的空白页。 这是一个令人头痛的问题,我正在考虑删除子报告,但它违背了报告的整个目的。

所以最后,解决的问题是不要将子报表放置在表中组的“详细信息”区域中,而是将它们放置在组的页脚中。 现在我知道这可能会改变/影响报告的格式,并且可能不符合您的报告目的。 但这为我解决了这个问题。 解决空白页问题的另一种方法是将子报表保留在任何位置(详细信息区域或组区域),并将其他详细信息区域移动到一个页脚区域中。 本质上需要记住的是减少表内细节/组带的数量。 如果可以管理的话,限制分组并在表中保留最小数量的子报表。

希望这对那里的人有帮助。

It took me a week to solve this one! But I did find a solution and happy to share it with you.

I had the exact same problem. In my main report, there is a Table that has 3 groups and 2 different subreports in each group. And these subreports had matrices. I believe regardless of matrices, subreports being placed inside group/detail bands within a table caused alot of unnecessary blank pages to be printed before, in between and after the sections. It was a pain the neck and I was thinking of removing the subreports but then it defeats the whole purpose of the report.

So finally, what fixed it was instead of placing the subreport in DETAIL bands of the groups in the table, place them in the Footer of the groups. Now I know this may change/affect the format of the report and may not fit in with your report purposes. But this fixed the issue for me. Another way of getting around the blank page issue was leaving the subreports wherever they are (detail or group bands), and moving OTHER detail bands into one Footer band. Essentially what needs to be kept in mind, is to reduce the number of detail/group bands inside the table. Limit the groupings and have minimum number of subreports within a table if you can manage that.

Hope this helps someone out there.

无法回应 2024-07-22 01:56:52

SSRS 2008
如果您的子报表位于任何组中,则应转到组属性并将该组的 keep Together 属性切换为 false。 这对我有用。

For SSRS 2008
If your subreports are in any group, you should go to group properties and switch the keep together property for that group(s) to false. This worked for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文