Tablix: Repeat header rows on each page not working - Report Builder 3.0
Asked Answered
D

6

189

I have a tablix with lots of rows that span over multiple pages. I have set the Tablix property Repeat header rows on each page but this does not work. I read somewhere that this is a known bug in Report Builder 3.0. Is this true? If not, is there something else that needs to be done?

Doublefaced answered 1/7, 2012 at 21:55 Comment(0)
P
489

It depends on the tablix structure you are using. In a table, for example, you do not have column groups, so Reporting Services does not recognize which textboxes are the column headers and setting RepeatColumnHeaders property to True doesn't work.

Instead, you need to:

  1. Open Advanced Mode in the Groupings pane. (Click the arrow to the right of the Column Groups and select Advanced Mode.)
    • Screenshot
  2. In the Row Groups area (not Column Groups), click on a Static group, which highlights the corresponding textbox in the tablix. Click through each Static group until it highlights the leftmost column header. This is generally the first Static group listed.
  3. In the Properties window, set the RepeatOnNewPage property to True.
    • Screenshot
  4. Make sure that the KeepWithGroup property is set to After.

The KeepWithGroup property specifies which group to which the static member needs to stick. If set to After then the static member sticks with the group after it, or below it, acting as a group header. If set to Before, then the static member sticks with the group before, or above it, acting as a group footer. If set to None, Reporting Services decides where to put the static member.

Now when you view the report, the column headers repeat on each page of the tablix.

This video shows how to set it exactly as the answer described.

Pious answered 2/7, 2012 at 17:31 Comment(11)
Stacia, when I select KeepWithGroup and try to save, I get "The tablix 'DetailTablix' has an invalid TablixMember. All TablixMember elements in a TablixColumnHierarchy must have the RepeatOnNewPage property set to false.". Any ideas?Unrivalled
I figured out my problem. Stacia your answer is absolutely correct, it's just a tricky thing to get just right. Note that Stacia says to change the ROW Groups area when setting the RepeatOnNewPage property. Everything else about this solution deals with columns, but you need to pick the Row groups (on the left), not the Column groups (on the right), even though you start by clicking the dropdown in Columns. Thanks Stacia, brilliant.Unrivalled
+1 - I just finished reading about a dozen walkthroughs on this all over the internet, and this is the best most direct resolution to the issue - you also explain WHY the options matter, which is fantastic. Thanks!Lysimeter
this video shows how to set it exactly as the answer described: youtube.com/watch?v=WAO819-gkKwSanitarium
@shrimprice i wish yours was the answer as I would mark it as so :P, i didnt realize it was the group section at the bottom of the report so i was all kinda of lost.Wax
KeepWithGroup=After was key for me. Like too many Microsoft things, this is a non-obvious trick needed to get a feature working. Thank you!Mcclimans
I am trying to export the report in PDF or excel. This is working fine for PDF. i.e, it is inserting row headers on every page. But for Excel I want to freeze the headers when I scroll. Is it possible..?Saharan
My left-most column is a grouping. So when I click through the list of Static column groups, it never selects the left-most one. So I can't set it to RepeatOnNewPage=true and KeepWithGroup=After. Ideas on how to do this, when your left-most column is a grouped column?Blameworthy
If your column headers have more than one row, you need to apply step 3 on each row. I.e. click each "static" item above the "Details" item and apply step 3.Kacikacie
The other "trick" I found was that the "Tablix Member" properties weren't showing. I thought it was because I was clicking wrong, but had to to to menu, View, then click "Properties".Heir
When I look at my Row Groups there IS NO static row group associated with my header rows. What would cause this? The header rows are in the Tablix, but the first Row Group is my outermost data row group.Padus
G
22

I have 2.0 and found the above to help; however, the selecting of a static did not highlight the cell for some reason. I followed these steps:

  1. Under column groups select the advanced and the statics will show up
  2. Click on the static which shows up in the row groups
  3. Set KeepWithGroup to After and RepeatOnNewPage to true

Now your column headers should repeat on each page.

Grooved answered 5/2, 2013 at 17:31 Comment(2)
This worked perfectly.... much simpler than above answer which didn't work for me.Eijkman
unfortunately this cause me to start getting blank pages again.Vday
T
13

How I fixed this issue was I manually changed the code behind (from the menu View/code). The section below should have as many number of pairs <TablixMember> </TablixMember> as the number of rows are in the tablix. In my case I had more pairs <TablixMember> </TablixMember>than the number of rows in the tablix. Also if you go to "Advanced mode" (to the right of "Column Groups") the number of static lines behind the "Row groups" should be equal to the number of rows in the tablix. The way to make it equal is changing the code.

<TablixRowHierarchy>
      <TablixMembers>
        <TablixMember>
          <KeepWithGroup>After</KeepWithGroup>
          <RepeatOnNewPage>true</RepeatOnNewPage>
        </TablixMember>
        <TablixMember>
          <Group Name="Detail" />
        </TablixMember>
      </TablixMembers>
    </TablixRowHierarchy>
Trudy answered 7/4, 2014 at 20:49 Comment(7)
To my surprise, doing this resolved the problem. I had a tablix w/ 6 rows (3 header rows plus a group w/ a header, detail, and footer row). Looking at the source showed 6 <TablixRow>s but 7 <TablixMember>s in the <TablixRowHierarchy>. I took my best guess as to which was the extra (one that wrapped the group) and removed it. This version failed to render, but the error message indicated that a row needed to have its <Repeat...> and <KeepWith...> settings changed to match the previous ones; I changed those to "true" and "After" in the 3rd (Static) row and voila! I wish I actually understood ;)!Dejong
Thanks for this. I've been using SSRS for over 10 years now and just ran into this issue - indeed, there was an extra wrapper of TablixMember around the group (no doubt from experiments with adding and removing groups). Cleaning up the member list solved the mysterious non-repeating header.Allaround
Thanks I had to delete two excess TablixMember rows that were grouped and had no data. The sign of this for me in my report was that there were two static row groups instead of one. Once I removed the excess XML nesting the repeating rows started working.Corrade
Thank you. Only this solution worked for my report where I was facing the similar problem.Akene
apparently the proper setting is missing in Visual Studio. So the „advanced settings“ tipps that refer to ReportBuilder didn't help. Manual editing of the file worked like a charm. Thanks!Pyrochemical
I had an extra <TablixMember> but also had an incorrect <TablixMembers> grouping. Once I deleted the extra member and corrected the groupings it worked! I am using MS Report Builder and had been playing around with some formats, adding a removing Tablixes, which is probably where the problems originated. Luckily the RDL files are plane text so I could edit it.Defelice
Perhaps this xmla is specific to an older version. I'm working in 2016 and there is no TablixRowHierarchy node in my code. Instead I have TablixCornerRows.Padus
B
11

Open Advanced Mode in the Groupings pane. (Click the arrow to the right of the Column Groups and select Advanced Mode.)

In the Row Groups area (not Column Groups), click on a Static group, which highlights the corresponding textbox in the tablix.

Click through each Static group until it highlights the leftmost column header. This is generally the first Static group listed.

In the properties grid:

  • set KeepWithGroup to After
  • set RepeatOnNewPage to True for repeating headers
  • set FixedData to True for keeping headers visible
Biennial answered 6/10, 2014 at 22:1 Comment(0)
A
5

Another way to accomplish this if you still have that issue is by doing the following :

  • Clear all the Table header text leave it empty.
  • On the Reports “Header” section add textboxes inside a rectangle , each textbox will represent a column header for the table.
  • As this rectangle is on the Reports Header section it will display on all report pages.

Thanks, Sufian.

Applejack answered 2/7, 2012 at 15:31 Comment(0)
I
2

What worked for me was to create a new report from scratch.

This done and the new report working, I will compare the 2 .rdl files in Visual Studio. These are in XML format and I am hoping a quick WindDiff or something would reveal what the issue was.

An initial look shows there are 700 lines of code or a bit more difference between both files, with the larger of the 2 being the faulty file. A cursory look at the TablixHeader tags didn't reveal anything obvious.

But in my case it was a corrupted .rdl file. This was originally copied from a working report so in the process of removing what wasn't re-used, this could have corrupted it. However, other reports where this same process was done, the headers could repeat when the correct settings were made in Properties.

Hope this helps. If you've got a complex report, this isn't the quick fix but it works.

Perhaps comparing known good XML files to faulty ones on your end would make a good forum post. I'll be trying that on my end.

Irmine answered 10/8, 2012 at 18:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.