Subreports try and keep together leaving blank spots/pages - reporting-services

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.

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'

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.
Go to the solution explorer, right click on your report and click on "View Code".
Search for your Subreport.
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.

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

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.

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.

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.

Related

SSRS - Page Break - Subreport

I have a report with two subreports inside. The main report has keeptogether true and page break checked in a group. Both subreports has keeptogether false and no page break.
My environment is SSRS 2008 and VS 2013 (Reportviewer 11)
I got two (separate) issues:
the page break is not working when I display the reports in reportviewer in browser. But it works when I export it into pdf.
if the main+subreports cannot fit to one page. then it basically cut the main report and subreport into different page (even though
keeptogether in mainreport is true and subreport is false)
Is there someone that can suggest what is going on? Some post stated that this is a default behaviour, if yes, is there any workaround for this?
Thanks before!
The default DisplayMode of the ReportViewer is set on Normal, try changing this to PrintLayout.
myReportViewer.SetDisplayMode(DisplayMode.PrintLayout);
When the report content exceeds the maximum page size it will break to a new page, there is no way of stopping this, in the designer the property even says "Keep together on one page if possible".
As your description of your actual report isn't completely clear, I'll assume that your main report has some data above the two subreports that you wish to be kept together.
To achieve this wrap that data inside a new Rectangle and set the KeepTogether property on True.
If I misunderstood you in anyway, just let me know and i'll update my answer.

SSRS 2008: Tablix header in Subreport not repeating

I have a subreport which is usually bigger than one page. The subreport has a heading which should repeat if the subreport is more than one page.
My solution was creating a Tablix Control and put the heading in the first row. In the details row I put the subreport.
First I tried to check Repeat header rows on each page in the Tablix properties to achieve the repeating header, but with no success.
After some research on the internet I found an approach that was already in discussion on stackoverflow and many other sites.
It's about using the "Advanced Mode" but this approach does not work for me either
Here is the link to the second approach on stackoverflow:
Stackoverflow Solution
Helps very appreciated...
There are two solutions that should work:
The Simplest
Open your subreport and move the header row into a textbox in the header of the subreport
Slightly more Complicated
Enter the Advanced Mode for the tablix containing the header row.
Click on the "(Static)" row that is your header row; it's probably the first/top "(Static)" row.
In the properties panel, you should see the row identified as "Tablix Member". If it says textbox1 or nothing at all then you need to repeat step 2.
Change Keep with Group property to "After".
Make sure Repeat on New Page to "True"
That should do it!
I searched in many articles and found that the problem exists in BIDS 2008. Later Microsoft released a fix regarding this.
But, the report designed earlier won't repeat the header. It needs to be redesigned from the beginning

How do you organize pages in reporting services without using subreports?

I have a report in reporting services which I designed by creating rectangles for each page. I then put all of the controls for displaying that report in the page in that rectangle. I've done this because I created my own "headers" and "footers" instead of using the built in header and footer functionality because I needed to put information in the header that is related to data in the attached dataset, which you can't do in their built in headers.
The problem I have is when I need to "insert" a new page into the middle of the document, there doesn't seem to be a way to "push" all of the following pages "down". For instance, let's say you have a report with 20 pages. Each page in a separate rectangle. Now, I want to select all of the rectangles from the 4th one down to the 20th one down. It takes forever if I start a selection near the 4th one and drag the mouse to the bottom waiting for the scroll bar on the side to scroll the page down.
Are there better ways of selecting everything from a certain point going down?
Is there a better way to organize a large report? I wouldn't mind using sub reports, but I think I'd end up with the same issue.
One benefit you would get from subreports is that the report would not be so large anymore. You can put each subreport in a rectangle and set their size them to a half-inch or less with cangrow set to true and they will expand out for you when the report is rendered. I would be cautious about data access within the subreports. It is my understanding that if you duplicate references to datasets in the subreports it can increase the number of calls to the database.
Has this helped? Let me know if you want any clarification or if I have missed the question.
Thanks.
Frank

Tablix header not repeating on new page, when subreport causes page break

I've been fighting with SSRS for too long now on what should be a simple matter. I'm hoping someone can help me see a solution.
I have a report which has a number of profiles, and each profile has a large number of data sections. The data sections (various tables and charts) are not related to each other in any way other than that they "key" back to the parent profile id.
The goal (which seems simple) is to have a header on each page with the profile information, and then have the data sections (each formatted completely differently) laid out.
The first problem we encountered was that for some reason SSRS2008 does not allow a tablix cell to contain another tablix with a different dataset (why it can't just require a filter based on the parent grouping is beyond me). The recommended workaround for this shortcoming is to either combine all data into a giant dataset (not possible here, data sections are too numerous and varied) or to embed subreports and pass in the parameters. While option number two increases the "work" needed to print a large number of profiles, we proceeded to implement this and it does work.
The problem comes in on the main tablix (the one containing the subreports) that has a static row header group set with "RepeatOnNewPage = true". This setting allows the header to show on every page as desired... except for subreports the span multiple pages, where the header is incorrectly ommitted.
For some reason, when the subreport spans multiple pages, the header of the parent tablix is not repeated! This is driving me insane as it would seem that a couple bad design decisions in SSRS has put me in a situation where I can't create the report I want... headers works without subreports, but I need subreports in order to "join" the data sections to the profile.
This would seem to be a simple and common requirement... after all, it's a report that is being migrated from a decades old reporting system. I've scoured StackOverflow and Google without success... I've seem a number of questions/answers about page breaks, but nothing that suggests a solution to this problem with subreports.
I'm posting this in case I'm missing something. If anyone has any suggestions at all, it would be much appreciated.
A very clean and simple way to repeat the column header on each page
http://www.a2zmenu.com/Blogs/BI/Tablix-headers-not-repeating-in-SSRS-2008.aspx
We've solved our problem... although not in the most ideal way.
The Page Header (of the "master" report, not the subreports) seems to be the only way to consistently have a header section.
We implemented a solution based in large part on this blog posting:
Maintaining State in Reporting Services 2008
We modified slightly from the blog post, removing "id" from the methods and including a GUID to ensure the report values are not mixed up even if the user runs several copies of the report at the same time. (When using shared variables, remember that they are global to the report running across execution instances and across users on the report server, so a lot of care needs to be taken when they are used!)
In the report body we have a hidden text block that calls:
=Code.SetValue("xxx",Fields!Field1.Value) & Code.SetValue("yyy",Fields!Field2.Value)
and in the report page header we reference these as (for example):
=Code.GetValue("xxx")
This works because the body is calculated before the page header, even for Page 1.
Still, in the end it is a hack for something that should be in Microsoft's product, given that they have poured years of development into this product! Why we cannot have nested tablix's and easier to use headers is beyond me... again this is upgrading a report from a program from the early 90's which did all this without problem. At the very least, give us report variables that can be retrieved and set as the report is processed!
Regardless, things are as they are... we've tested the solution with shared variables and it seems to be working very well. We're going to run stress tests to make sure it's implemented correctly, I'll post something here if we find any further problems.
(And if anyone knows of some other way to get consistent header rows on pages, even when there are detail rows with large heights, please share...)
We have faced exactly the same problem during implementation of customer demands on SSRS Reports,
And did try a lot of things which all of them resulted with failure.
In our case,
Main Report has 4 subreport. Each SubReport should be started in new page. And also when new subreport begins, page header should be changed dynamically based on Subreport in body in current page.
Also one of SubReports which was SubReport3 has another case. Basically Main Report was running based on Dealer level. But Customer wants SubReport3 to run for each SubDealer related with #Dealer parameter. Also Customer wants to see each SubDealer data started in New page inside SubReport3.
As a result, we found different workaround as follows.
We created Page Header to Main Report. (Report Menu -> Add Page Header)(As #codinginthevoid said it is most consistent way)
We putted 4 subreports inside separate tablix. We added new column to each tablix. That column in each tablix visiblity = false, width of that column can be as small as possible, then created placeholder inside of that column, wroted down expression as follows:
If expression is in Tablix1, expression was ="Tablix1", if in Tablix2 then "Tablix2" and etc.
Then started design page header for Tablix1, each report item in pageheader that was putted for Tablix1 has visibility expression as follows:
=ReportItems!Tablix1_HiddenTextbox1.Value IS NOTHING
then applied same thing for Tablix2 and etc.
In the end, there were lots of textbox in PageHeader of report and some of them position was completely same, overlapped, But when reports is being rendered, each of those textboxes is being shown it is related page with related subreport.
I have encountered the same problem as well. What I found was that the way to solve the issue was to de-normalise the data, adding a 'Record Type' field to identify whether the row was a parent or a child.
There were two sub-tables in my tablix, both displaying detail data linked to the outer grouping. If I set the headers of the sub-tables to repeat on every page (using the Advanced arrow > Static Properties > KeepTogether = True, KeepWithGroup = After, RepeatOnNewPage = True) then one of the sub-tables would display correctly, however the parent table's repeating header would just disappear.
To keep a long story short, this was a massively annoying problem to solve. The solution is simple, it worked for me, but may not work for everyone.
Linked below is a SSRS2008 example RDL that connects to localhost and has an example of the problem I had and also the solution I implemented. Please feel free to use it if you find it useful!
(I would've posted it on here but Stack Overflow fails for code blocks it seems)
http://www.sqlservercentral.com/Forums/Topic1111567-1633-1.aspx?Update=1

How do I shows column headers of main report on each page when subreport renders on more than one pages

I have few subreports in a sql main report(.rdl file) using VS/SSRS 2008.
The subreports start approximately on the middle of the page in the main report detail section. I have one group in main report, shows header information and pass one parameter - ReportID to each subreport.
I also have checked both:
Row Headers – “Repeat header rows on each page” and
Column Headers – “Repeat header columns on each page”
on General tab of Tablix properties of the main report.
If I have few detail lines in the subreport, so that all can be rendered on page one, everything is ok.
If I have more detail lines in the subreport so that it's not possible to print all on one page, the subreport renders from the fist page and moves on to page two, three and so on.
When I have more than one page of data in the subreport, it is also started on page one, and continues renders on second page and so on...
However, it doesn't show the main report's column/row headers on subsequent pages of the subreports?
I've noticed that when next item/ReportID starts in my main report group, it prints column header only on the first page but not any subsequent page and so on...
I also tried to check only ONE, either
Row Headers – “Repeat header rows on each page” OR
Column Headers – “Repeat header columns on each page”
on general tab of Tablix properties of the main report BUT didn’t work?
Any ideas how to print header info on each page when subreport has more than one page data?
Pagination is always fun in SSRS.
Have you looked at the page size/interactive of the subreport? This may stop the subreport paging, but I don't know if it's what you want.
An older article on pagination
And a newer one
Presently I am encountering the same problem. In a previous SSRS report we got it to work by putting our tablix inside a single-cell list item so that the headers were repeated. Now I am working on a different report, and when I try the same thing I'm getting this error:
[rsInvalidDetailDataGrouping] The tablix ‘tablixOpportunitySummary’ has a detail member with inner members. Detail members can only contain static inner members.
I've searched extensively, but this is the only link which indicates an known problem in SSRS. At the time of this post it contained 4 workarounds:
https://connect.microsoft.com/SQLServer/feedback/details/337720/katmai-reporting-services-2008-tablix-control-repeat-column-headers-does-not-work#
A little late, but I think this is what you are looking for:
You need to go to tablix properties > General and check the option Keep header visible while scrolling. Then go to column/row groups in the advanced mode, chose your static row and set the Fixed Data mode to True, Repeat on new page to True and Keep with group to After.
Here is probably the best reference: Here