Ayrton Senna
Ayrton Senna

Reputation: 3835

Tablix: Repeat header rows on each page not working

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 (I'm using v3.0). Is this true? If not, is there something else that needs to be done?

Upvotes: 191

Views: 220034

Answers (5)

user3508487
user3508487

Reputation: 131

I have fixed this issue by manually changing the Tablix markup/code behind (from the menu view/code).

The section below should have as many number of pairs of <TablixMember> </TablixMember> as the number of rows there 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" at the bottom of Report Builder) 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>

Upvotes: 13

Stacia
Stacia

Reputation: 7218

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 at the bottom section of your Report Builder window (Click the down arrow to the right of the Column Groups header and select Advanced Mode).
  • Screenshot of Advanced Mode being selected from the Groupings pane
  1. 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 (if you have multiple) until it highlights the leftmost column header. This is generally the first Static group listed.
  2. In the Properties window, set the RepeatOnNewPage property to True:
  • Screenshot of the Properties window showing the "RepeatOnNewPage" property

    (If you don't have the Properties window open, click the View tab at the top of Report Builder and check the box for Properties):

  • Screenshot of the Properties menu option

  1. 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.

Upvotes: 494

user1585204
user1585204

Reputation: 965

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.

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

Upvotes: 2

Sufian O
Sufian O

Reputation: 141

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.

Upvotes: 5

Elmer
Elmer

Reputation: 137

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

Upvotes: 10

Related Questions