Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subreports try and keep together leaving blank spots/pages

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.

like image 258
Dustin Brooks Avatar asked Mar 11 '09 15:03

Dustin Brooks


2 Answers

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'

like image 61
Nathan Avatar answered Sep 28 '22 07:09

Nathan


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.

like image 36
Nidhesh1 Avatar answered Sep 28 '22 05:09

Nidhesh1