views:

4254

answers:

8

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.

+2  A: 

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.

vinny
I'm sure that's it. I tested it on the SELECT * FROM Foo example above and reproduced the behavior as you described. Many thanks.
I Have the Hat
It's funny how the RepeatColumnHeaders property apparently does *nothing* though... sigh.
I Have the Hat
I had a senario where I had to recreate the tablix to clean up the XML, then I had to manually insert the <RepeatOnNewPage>true</RepeatOnNewPage> per "I Have the Hat's" comment. Grr... :-)
Jeff
+9  A: 

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.

I Have the Hat
This worked for me two, but it was very picky. I had to recreate my tablix and then drop the tag into the TablixRowHierarchy as indicated.
Jeff
+6  A: 

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.

vinny
Nice! That worked. You are an asset to Stackoverflow... although we may be the only two users looking at SSRS questions... haha. Thanks again.
I Have the Hat
I don't remember seeing this but in RS2005, so I think this is a 2008 issue. That's probably why not a lot of people have run into it yet.
Jeff
+1 for the solution. For all people who have problems to find the advanced mode (like me), look at http://stackoverflow.com/questions/488900/reporting-services-tablix-repeatcolumnheaders-doesnt-work-on-some-reports/2986024#2986024, the last paragraph shows where to find
HCL
A: 

Amazing articles guys. You guys rock!!!

Sandesh Bharadwaj
+1  A: 

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.

+1 For showing how to set the RepeatOnNewPage-option from the designer
HCL
A: 

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:

  1. Right click on one title row and "Add Group (Column Group)", Parent Group
  2. Group by '1' (this group will later be deleted so it doesn't matter what you put there
  3. Click OK and the a Header row is added.
  4. Merge all columns in the new header row
  5. In the column group pane, right click on group just created and "Delete Group", select box for "group only" important
  6. Now you have header row you can insert row above or below to add more header lines.
  7. Move your title rows into the new header rows and delete your old title rows.
  8. 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

Alan
A: 

Alan, your answer is the only one that worked for me from all the 'answers' I've read from multiple websites.

Thank you!

A: 

Alan, thanks so much for this simple solution! I had given up solving this problem.

Lee