Reporting Services:Tablix RepeatColumnHeaders不适用于某些报表

时间:2021-09-30 08:23:46

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.

所以我有各种各样的报告,包括一个以Tablix呈现的DataSet ......漂亮的花园种类。 Tablix控件有一个名为RepeatColumnHeaders的属性,我为每个报告设置为True。对此属性的说明指出“指示是否在每个页面上重复出现列标题,数据区域的哪一部分出现。”听起来非常简单,但在某些报告中它可以正常工作而在其他报告上则不然。我似乎无法找到可能影响这一点的报告的不同之处。在一个标题重复的报告中,有一些相当神秘的分组mojo,但在一个不起作用的例子中,Tablix只有一个级别 - 没有分组。我希望多嵌套的是问题,而不是扁平问题。

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.

也许这完全是一个不同的问题。我将一个简单的Tablix渲染为SELECT * FROM Foo,接受所有默认值,这导致RepeatColumnHeaders被设置为False,并且看到列标题重复该报告... Grrr。

Any insights greatly appreciated.

任何见解都非常感谢。

7 个解决方案

#1


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.

从我设法挖掘的东西来看,它有点不稳定。在分组窗格中,选择高级模式,然后选择最外面的静态行。然后,您应该看到“RepeatOnNewPage”属性。

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:

更新:查找高级模式:@HCL的评论链接到@ user359904的其他答案,其中包含有关如何查找和进入高级模式的信息:

  1. Select the tablix
  2. 选择Tablix

  3. Below the report are "Row Groups" and "Column Groups", all the way to the right of "Column Groups" is a small downward arrow.
  4. 报告下方是“行组”和“列组”,“列组”右侧一直是一个小的向下箭头。

  5. Click the arrow, choose Advanced Mode.
  6. 单击箭头,选择“高级模式”。

#2


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.

谢天谢地,我没有必要重新创建我的Tablix。我有三行组成了我的tablix标题。我在*别组之外添加了三行。这些行未绑定到任何组。我修改了行,以便它们完全复制了我在*别组中的标题行。对于每个标题行,我将KeepWithGroup属性设置为“After”,将“RepeatOnNewPage”属性设置为true。我测试了这份报告。标题出现在每个页面的顶部,但是由于*别组内部和*别组之上的标题行的重复,标题在第一页的顶部和每个分节符重复两次。我删除了最上面部分的标题行,复制消失了。在*别组的每个中断和每个页面的顶部正确重复标题。*别组中没有标题行。

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.

设置KeepWithGroup和RepeatOnNewPage:选择Tablix。在设计窗格下方的组框中,单击文本右侧的向下箭头,显示“列组”,并确保选中“高级模式”。单击第一个静态行并将KeepWithGroup属性设置为“After”和“RepeatOnNewPage”为true。对构成标题的每一行执行此操作。

#3


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:

情节变浓。在三个测试中,我发现在使用向导创建报告和获取所需的标题行为之间以及不使用向导和无法实现所需行为之间存在1:1的相关性。从那里我扩展了rdl文件的工作和非工作示例,并找到了这个元素:

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

我将相同的内容添加到非工作rdl并且标题开始重复。

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.

但是,我不能在设计师中找到一个设置,属性等来切换它。它似乎根本不符合前面描述的明显属性。它只是巫师的神器吗?幸运的是,这是一个相当简单的解决方法,因为我无法使用向导重新创建十几个报告。

#4


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:

您的帖子仍在使用;)谢谢大家。我建立在你提供的内容之上,提出了一个恢复重复标题行的解决方案。我没有必要使用高级模式,只是一些见解...我在所有行组之外有两个标题行,没有列组。以下是我将两个标题行放入tablix标题中所做的工作:

  1. Right click on one title row and "Add Group (Column Group)", Parent Group
  2. 右键单击一个标题行和“添加组(列组)”,父组

  3. Group by '1' (this group will later be deleted so it doesn't matter what you put there
  4. 按“1”分组(此组稍后将被删除,因此您放置的内容无关紧要

  5. Click OK and the a Header row is added.
  6. 单击“确定”,添加“标题”行。

  7. Merge all columns in the new header row
  8. 合并新标题行中的所有列

  9. In the column group pane, right click on group just created and "Delete Group", select box for "group only" important
  10. 在列组窗格中,右键单击刚刚创建的组和“删除组”,选择“仅限组”重要框

  11. Now you have header row you can insert row above or below to add more header lines.
  12. 现在您有标题行,您可以在上方或下方插入行以添加更多标题行。

  13. Move your title rows into the new header rows and delete your old title rows.
  14. 将标题行移动到新标题行中并删除旧标题行。

  15. Last... make sure you check the Tablix property to "Repeat Column Headers on each page"
  16. 最后...确保检查Tablix属性为“在每个页面上重复列标题”

It worked well and easily repeatable (I had many tablixes).

它工作得很好,很容易重复(我有很多tablix)。

Sincerely, Alan

#5


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.

在标题不重复的报告中,您是否在任何时候删除了Tablix中的默认标题行?一旦我这样做,无论我尝试什么设置,Tablix中的标题都不会重复。我不得不重新创建Tablix以使其工作。

#6


I am adding some screenshots from my SSRS 2012 server..

我正在从我的SSRS 2012服务器添加一些截图..

Reporting Services:Tablix RepeatColumnHeaders不适用于某些报表

Now, click on the "(Static)" under "Row Groups" and presss F4.

现在,单击“行组”下的“(静态)”,然后按F4。

Reporting Services:Tablix RepeatColumnHeaders不适用于某些报表

Also read TechNet - SSRS: How to Repeat Headers on Each Page

另请阅读TechNet - SSRS:如何在每页上重复标题

#7


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.

它现在是2014年,我正在运行2012版本,我用你的帖子来解决我的问题 - 我们店里经验丰富的SSRS开发人员不知道如何解决(我只是一个新手)。非常感谢您提供解决方案 - 这似乎是一个永恒的问题。

#1


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.

从我设法挖掘的东西来看,它有点不稳定。在分组窗格中,选择高级模式,然后选择最外面的静态行。然后,您应该看到“RepeatOnNewPage”属性。

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:

更新:查找高级模式:@HCL的评论链接到@ user359904的其他答案,其中包含有关如何查找和进入高级模式的信息:

  1. Select the tablix
  2. 选择Tablix

  3. Below the report are "Row Groups" and "Column Groups", all the way to the right of "Column Groups" is a small downward arrow.
  4. 报告下方是“行组”和“列组”,“列组”右侧一直是一个小的向下箭头。

  5. Click the arrow, choose Advanced Mode.
  6. 单击箭头,选择“高级模式”。

#2


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.

谢天谢地,我没有必要重新创建我的Tablix。我有三行组成了我的tablix标题。我在*别组之外添加了三行。这些行未绑定到任何组。我修改了行,以便它们完全复制了我在*别组中的标题行。对于每个标题行,我将KeepWithGroup属性设置为“After”,将“RepeatOnNewPage”属性设置为true。我测试了这份报告。标题出现在每个页面的顶部,但是由于*别组内部和*别组之上的标题行的重复,标题在第一页的顶部和每个分节符重复两次。我删除了最上面部分的标题行,复制消失了。在*别组的每个中断和每个页面的顶部正确重复标题。*别组中没有标题行。

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.

设置KeepWithGroup和RepeatOnNewPage:选择Tablix。在设计窗格下方的组框中,单击文本右侧的向下箭头,显示“列组”,并确保选中“高级模式”。单击第一个静态行并将KeepWithGroup属性设置为“After”和“RepeatOnNewPage”为true。对构成标题的每一行执行此操作。

#3


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:

情节变浓。在三个测试中,我发现在使用向导创建报告和获取所需的标题行为之间以及不使用向导和无法实现所需行为之间存在1:1的相关性。从那里我扩展了rdl文件的工作和非工作示例,并找到了这个元素:

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

我将相同的内容添加到非工作rdl并且标题开始重复。

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.

但是,我不能在设计师中找到一个设置,属性等来切换它。它似乎根本不符合前面描述的明显属性。它只是巫师的神器吗?幸运的是,这是一个相当简单的解决方法,因为我无法使用向导重新创建十几个报告。

#4


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:

您的帖子仍在使用;)谢谢大家。我建立在你提供的内容之上,提出了一个恢复重复标题行的解决方案。我没有必要使用高级模式,只是一些见解...我在所有行组之外有两个标题行,没有列组。以下是我将两个标题行放入tablix标题中所做的工作:

  1. Right click on one title row and "Add Group (Column Group)", Parent Group
  2. 右键单击一个标题行和“添加组(列组)”,父组

  3. Group by '1' (this group will later be deleted so it doesn't matter what you put there
  4. 按“1”分组(此组稍后将被删除,因此您放置的内容无关紧要

  5. Click OK and the a Header row is added.
  6. 单击“确定”,添加“标题”行。

  7. Merge all columns in the new header row
  8. 合并新标题行中的所有列

  9. In the column group pane, right click on group just created and "Delete Group", select box for "group only" important
  10. 在列组窗格中,右键单击刚刚创建的组和“删除组”,选择“仅限组”重要框

  11. Now you have header row you can insert row above or below to add more header lines.
  12. 现在您有标题行,您可以在上方或下方插入行以添加更多标题行。

  13. Move your title rows into the new header rows and delete your old title rows.
  14. 将标题行移动到新标题行中并删除旧标题行。

  15. Last... make sure you check the Tablix property to "Repeat Column Headers on each page"
  16. 最后...确保检查Tablix属性为“在每个页面上重复列标题”

It worked well and easily repeatable (I had many tablixes).

它工作得很好,很容易重复(我有很多tablix)。

Sincerely, Alan

#5


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.

在标题不重复的报告中,您是否在任何时候删除了Tablix中的默认标题行?一旦我这样做,无论我尝试什么设置,Tablix中的标题都不会重复。我不得不重新创建Tablix以使其工作。

#6


I am adding some screenshots from my SSRS 2012 server..

我正在从我的SSRS 2012服务器添加一些截图..

Reporting Services:Tablix RepeatColumnHeaders不适用于某些报表

Now, click on the "(Static)" under "Row Groups" and presss F4.

现在,单击“行组”下的“(静态)”,然后按F4。

Reporting Services:Tablix RepeatColumnHeaders不适用于某些报表

Also read TechNet - SSRS: How to Repeat Headers on Each Page

另请阅读TechNet - SSRS:如何在每页上重复标题

#7


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.

它现在是2014年,我正在运行2012版本,我用你的帖子来解决我的问题 - 我们店里经验丰富的SSRS开发人员不知道如何解决(我只是一个新手)。非常感谢您提供解决方案 - 这似乎是一个永恒的问题。