SSRS hidden rows cause KeepWithGroup to not work - reporting-services

I have a report that consists of a single table with 3 groups. The last group has 6 rows in it's footer. Each of these rows has KeepWithGroup set to Before and some of them can be hidden conditionally. When all of the rows are visible, the footer rows are kept on the same page as the detail where possible. However, when one of the Hidden conditions evaluates to true the row is hidden correctly but the other rows are moved to the next page even though they would fit fine on the current page.
If I look at the groups in advanced mode I see this
(Static)
(Group1)
(Static)
(Group2)
(Static)
(Static)
(Group3)
(Static)
(Static)
(Static) -- Don't know why this is here
(Group4) -- This is the detail
(Static)
(Static)
(Static)
(Static)
(Static)
(Static)
(Static)
All of the Static rows after the detail have KeepWithGroup set to Before, but this seems to be ignored when any of them are hidden.
I've tried setting the hidden condition on the table row and on the static row in advanced mode but both cause the issue.
Any ideas?
Thanks,
Bill

I have two ideas for you to try:
In setting the advanced properties up of your grouping try to change the 'Hidden' property to an expression evaluating if there is data in the parent grouping.
=IIF( Fields!(parentitem).value != Nothing, false, true)
Is it okay to repeat one of the groups on a page break? Generally forcing page breaks in my experience helps with keeping data together more often than not. That and tweaking the options of 'KeepTogether' to TRUE of the 'Static' members and maybe attempting to change 'KeepWithGroup' to After instead.
I know I usually avoid the advanced mode of groupings unless there is an issue with display which sounds like you have fell into unfortunately. While debugging you may wish to see if you remove the highest parent group if the problem still persists to see where the layout is causing issues at. I know with groups that shared dependent members across multiple heirarchies there can be issues. You could also attempt doing a subreport that you know works that is called as a child of a parent member while debugging. This would not be a final result as it would be kind disjointed IMHO, but may help to see where the dependency problem lies.
I also saw another article posted by someone that had similar issues: http://blogs.msdn.com/b/robertbruckner/archive/2008/10/13/repeat-header-and-visible-fixed-header-table.aspx

Related

SSRS Stop group in tablix being split across printing pages

I have a tablix in SQL REPORTS (SSRS) that has many grouped items.
It fits roughly 3.5 groupped item per page when printnig, however I dont want the groups to be split up over the 2 pages, I want a pagebreak to happen whenever the group needs to be split.
I dont want to have it 1 group per page either, I know there is an option for that.
At the bottom of the report builder, you will see two boxes, Row Groups and Column Groups. Select the Column Groups drop down, click "Advanced Mode" and then in Row groups highlight "Details". In Properties under the "Other" section, select "True" for Keep Together. and save. This should work.
Note: I know this is old hope this helps people starting out though.
Modifying the property Other -> KeepTogether of the outermost row group desired to keep within a single page worked for me using Report Builder 3.
My KeepTogether values for each Row Group
Notice in my example, KeepTogether is false for table1_Group1. I don't want to keep my entire dataset together. Instead I want to keep only individual groupings of that dataset together.
In order to see the Properties panel, enable the Properties checkbox under the Show/Hide section of the View tab of the Ribbon.
My View settings
Probably the best place to start is the group-level KeepTogether property.
Indicates whether to keep all sections of the data region together on
one page.
I have just worked through 3 similar reports that were all suffering this issue.
It was only when I marked the group row AND the detail row to get the report to force a page break and keep the pages together.
Interestingly, I can then set the DETAIL BACK to false and the report still functions correctly. I have no explanation as to why, but this was repeatable.
I am using SQL Server 2016 Report Builder (the red one)
I tried all options about that. When I have a more difficult group, it sometimes happens, that the group will be split across pages. Even though setting "Keep Together" property to True.
My solution is:
don't use multiple rows
use one row with rectangle
to rectangle import TextBoxes and fill them with expression "=Fields!Column.Value"

Unable to disable SSRS 2008 page breaks

I've always hated working with SSRS and I'm currently pulling my hair out over page breaks.
My report has a table with products which are grouped by a purchase. I want all purchases' product tables to appear on a single page, instead of one page for each unique grouping value.
Whenever I Google how to disable paging everyone points to this thread which I have followed - both interative height and width are at 0.
Starting at my table (wtf is a 'tablix'?) I have checked the PageBreak property of every container and all are set to 'None'.
The ONLY way I have so far managed to disable paging is to edit the report's XML and replace every instance of <BreakLocation>Between</BreakLocation> with <BreakLocation>None</BreakLocation>. According to this MSDN article None is a valid value, but after this change Business Intelligence Developer Studio can no longer display the report, complaining "Deserialization failed: Requested value 'None' was not found". **Slow clap for BIDS.
My three specific questions are:
Why can't I see the BreakLocation property anywhere in the report designer?
Why is BreakLocation being set to 'Between' when everywhere possible I have set PageBreak to None?
Is there any other way I can achieve what I desire that doesn't require editing the XML before and after using the designer?
I am using Business Intelligence Developer Studio 2008 and rendering reports in HTML.
Any suggestions much appreciated.
You can do this in your XML by finding your <Page> tag and adding
<InteractiveHeight>0in</InteractiveHeight>
in the beginning (or replacing the existing one).
(A tablix is a combination of a table and a matrix, it's what 2008 does with your reports. Easier to see if you use Report Builder 2.0)
You say you checked the page break location on every "container", but Tablix groups can also have their own page breaks. You'll need to check those too and make sure they are set to None.
I can't speak for why BIDS isn't allowing you to specify None as a BreakLocation. None certainly is a valid value as far as RDL is concerned.
With InteractiveHeight set to 0 and certainty that there are no BreakLocation tags in your report set to anything other than None, there really shouldn't be any pagination.
I had the same problem. Ath first I used the xml to find the tablix or tablix group which contained the page break. Later I found out that it could be solved by removing the PageBreak section entirely from the xml.

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

Report Services: Controlling page breaks inside a table

I'm using a table on my report to present the data. Since it was a lot of data and I wanted to print the report on a A4 page, I split each row into 3 different rows.
My problem is when the report goes to the second page, I want it to break before or after the 3 rows.
example:
name age
address
contact
name age
address
contact
name age
address
* page break *
contact
this is what normally happens. I want to ensure that the page break only happens on the lines.
There are multiple strategies to follow:
The KeepTogether is useful in this case
If you want it to fit on one page only try adjusting page margins, padding, font size, line height to make the report render more compactly
Another alternative is to create a table group on the person, and from the group properties (edit group) check the page break at end property. this way you can have each group on a separate page
Hope this helps
I'm ended up creating a subreport to represent each item.
I looked for the KeepTogether property but that's probably only for reporting services 2008 (I'm using 2005).
If you have the table in a subreport, you must also Right Click -> Format Object -> Uncheck Keep object together.
This was the step that did it for me after I unchecked Keep object together on the table and the subreport details.
I had the same problem, tried 'Keep together' and it didn't work. After a long time of changing and trying many things the one thing that did the job was reducing the bottom margin of a page.

Reporting Services: Tablix RepeatColumnHeaders doesn't work on some reports

So I've got various reports that consist of a DataSet rendered in a Tablix... pretty garden variety stuff. There is a property for the Tablix control named RepeatColumnHeaders, which I have set to True for each report in question. The explanation for this property states “Indicates whether column headers are repeated on each page on which part of the data region appear.” Sounds pretty straightforward, but on some reports it works and on others it does not. I can't seem to find what's different about the reports that might affect this. On one report where the headers do repeat, there is some fairly arcane grouping mojo, but in an example where it doesn't work the Tablix only has one level--no grouping. I would expect the multi-nested one to be the problem, not the flat one.
Maybe it's a different problem altogether. I threw together a simple Tablix rendering SELECT * FROM Foo, accepted all the default values, which results in RepeatColumnHeaders being set to False, and lo and behold the column headers do repeat for that report... Grrr.
Any insights greatly appreciated.
It's a bit wonky from what I've managed to dig up. In your grouping pane, select advanced mode, then select your outermost static row. You should then see the "RepeatOnNewPage" property.
Update: finding Advanced Mode:
The comment by #HCL links to the other answer by #user359904, that has the info on how to find and enter Advanced Mode:
Select the tablix
Below the report are "Row Groups" and "Column Groups", all the way to the right of "Column Groups" is a small downward arrow.
Click the arrow, choose Advanced Mode.
I found a solution that works for me. Vinny's answer led me to it.
Thankfully, I didn't have to recreate my tablix. I had three rows that made up my tablix header. I added three rows outside of the highest level group. These rows are not bound to any group. I modified the rows so that they exactly duplicated the header rows I had in my highest level group. I set the KeepWithGroup property to "After" and the "RepeatOnNewPage" property to true for each of these header rows. I tested the report. The header appeared at the top of every page but due to the duplication of the header rows both inside the highest level group and above the highest level group, the header repeated twice at the top of the first page and at every section break. I deleted the header rows in the topmost section and the duplication went away. Headers repeat correctly at the each break of the highest level group and at the top of each page. There are no header rows in the highest level group.
To set KeepWithGroup and RepeatOnNewPage: Select the tablix. In the group box below the design pane, click on the down arrow to the right of the text that reads "Column Groups" and make sure "Advanced Mode" is checked. Click the first static row and set the KeepWithGroup property to "After" and "RepeatOnNewPage" to true. Do that for each of the rows that comprise your header.
Sorry to beernuts for un-marking your response as the answer; I hope you get to keep the rep points.
The plot thickens. In three tests I found a 1:1 correlation between using the wizard to create a report and getting the desired header behavior, as well as between not using the wizard and not being able to achieve the desired behavior. From there I diff'd the rdl files for a working and non-working example and found this element:
<RepeatOnNewPage>true</RepeatOnNewPage>
In the document at:
Report > Body > ReportItems > Tablix > TablixBody > TablixRowHierarchy
> TablixMembers > TablixMember
I added the same to the non-working rdl and the headers started repeating.
I cannot, however, find a setting, property, etc in the designer that toggles this. It does not seem to correspond at all to the obvious properties as described previously. Is it just an artifact of the wizard? Fortunately it's a fairly easy work-around as I couldn't face recreating a dozen reports using the wizard.
Your post is still being used ;) Thank you all. I built upon what you provided to come up with a solution to restore repeating header rows. I did not have to use the Advanced mode, just some insight... I had two title rows outside all row groups with no column groups. Here is what I did to get the two title rows into the tablix header:
Right click on one title row and "Add Group (Column Group)", Parent Group
Group by '1' (this group will later be deleted so it doesn't matter what you put there
Click OK and the a Header row is added.
Merge all columns in the new header row
In the column group pane, right click on group just created and "Delete Group", select box for "group only" important
Now you have header row you can insert row above or below to add more header lines.
Move your title rows into the new header rows and delete your old title rows.
Last... make sure you check the Tablix property to "Repeat Column Headers on each page"
It worked well and easily repeatable (I had many tablixes).
Sincerely, Alan
In your reports where the header doesn't repeat, did you delete the default header row in the tablix at any point? Once I did that, no matter what setting I tried, the header in the tablix wouldn't repeat. I had to re-create the tablix to get it to work.
It's now the year 2014 and I'm running 2012 version and I used your post to solve my problem - one that experienced SSRS developer in our shop didn't know how to solve (I'm just a newbie). Thanks so much for contributing your solution - it seems to be a timeless issue.
I am adding some screenshots from my SSRS 2012 server..
Now, click on the "(Static)" under "Row Groups" and presss F4.
Also read
TechNet - SSRS: How to Repeat Headers on Each Page