Subreports try and keep together leaving blank spots/pages
Asked Answered
O

6

8

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.

Orlando answered 11/3, 2009 at 15:28 Comment(3)
I am having the exact same problem... so frustrating. I am not sure there is a solution tho. SSRS seems to want to put everything on a single page if it can, regardless of what you want...Reformer
*** This does not appear fixed in SSRS 2008 R2 **** Have seen the problem in two workplaces now, both with SSRS2008 (latest updates as at January 23 2012). Toggling keep together with sub-reports has no effect.Dilapidation
I am having the same issue. Instead of a report server, I have rdlc files in my website. I have set KeepTogether to false everywhere, but my main report continues to keep my subreports together. Does anyone know a solution for this?Lamelli
R
6

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'

Reformer answered 4/5, 2009 at 6:39 Comment(5)
Thanks for pointing me toward the article. I guess I'll just have to do what I can and hope a fix comes out. I have a dynamic report builder that users use to create the reports, not using sub-reports (while not impossible) is out of the question. It would just take too much re-writing to make it worth the effort.Orlando
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.Orlando
*** This does not appear fixed in SSRS 2008 R2 **** Have seen the problem in two workplaces now, both with SSRS2008 (latest updates as at January 23 2012). Toggling keep together with sub-reports has no effect.Dilapidation
Are you sure it was 2008 R2? It is a separate update stream to regular SSRS2008...Reformer
This does seem to be fixedFern
D
4

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.

Dumpling answered 16/5, 2012 at 15:22 Comment(2)
On item 3, your tag name is empty. I'm not sure what to look for. I have already tried looking for an empty tag name, but found nothing.Lamelli
This worked for me. I went through the XML code behind for the report and changed every reference to KeepTogether to falseFern
K
1

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

Kempis answered 26/9, 2010 at 20:24 Comment(2)
Doesn't exist in Reporting Services 2005.Orlando
It does exist in 2005 under the Table->Layout Properties.. but unfortunately it doesn't do a thing..Hospital
S
0

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.

Sachiko answered 4/12, 2009 at 19:45 Comment(1)
Was this done in 2008? Because you definitely cannot place a sub-report in the header or footer in 2005Hospital
G
0

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.

Gloriole answered 26/7, 2013 at 1:39 Comment(0)
H
0

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.

Haldeman answered 1/3, 2014 at 5:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.