Tablix:在每个不工作的页面上重复标题行——报告构建器3.0

时间:2022-08-23 08:11:20

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?

我有一个tablix,它有很多行跨越多个页面。我已经在每个页面上设置了Tablix属性Repeat header行,但这不起作用。我在某个地方读到报告构建器3.0中有一个已知的bug。这是真的吗?如果没有,还有什么需要做的吗?

6 个解决方案

#1


343  

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.

这取决于您使用的tablix结构。例如,在表中,您没有列组,因此Reporting Services不能识别哪些文本框是列标题,将RepeatColumnHeaders属性设置为True是无效的。

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.)
    • Tablix:在每个不工作的页面上重复标题行——报告构建器3.0
  2. 在分组窗格中打开高级模式。(单击列组右侧的箭头,选择高级模式)
  3. 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.
  4. 在行组区域(不是列组)中,单击一个静态组,它突出显示tablix中相应的文本框。单击每个静态组,直到它突出显示最左侧的列标题。这通常是列出的第一个静态组。
  5. In the Properties window, set the RepeatOnNewPage property to True.
    • Tablix:在每个不工作的页面上重复标题行——报告构建器3.0
  6. 在属性窗口中,将RepeatOnNewPage属性设置为True。
  7. Make sure that the KeepWithGroup property is set to After.
  8. 确保KeepWithGroup属性设置为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.

KeepWithGroup属性指定静态成员需要坚持到哪个组。如果设置为After,则静态成员将在组之后,或在组之下,充当组头。如果设置为Before,那么静态成员将与之前的组保持一致,或在其之上,作为组页脚。如果设置为None,那么Reporting Services将决定将静态成员放在何处。

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

现在,当您查看报表时,列标题会在tablix的每个页面上重复。

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

本视频展示了如何按照所描述的答案进行设置。

#2


12  

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:

我有2.0,并且找到了上面的帮助;但是,由于某些原因,静态选择没有突出显示单元格。我跟着这些步骤:

  1. Under column groups select the advanced and the statics will show up
  2. 在列组下,选择高级的和静态的
  3. Click on the static which shows up in the row groups
  4. 单击在行组中显示的静态。
  5. Set KeepWithGroup to After and RepeatOnNewPage to true
  6. 将KeepWithGroup设置为After,并将RepeatOnNewPage设置为true

Now your column headers should repeat on each page.

现在你的列标题应该在每个页面上重复。

#3


7  

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.

在行组区域(不是列组)中,单击一个静态组,它突出显示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
  • 设置KeepWithGroup后
  • set RepeatOnNewPage to True for repeating headers
  • 将RepeatOnNewPage设置为True用于重复标题
  • set FixedData to True for keeping headers visible
  • 将FixedData设置为True,以保持头可见。

#4


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.
  • 在报表“Header”部分中,在矩形中添加文本框,每个文本框将表示表的列标题。
  • As this rectangle is on the Reports Header section it will display on all report pages.
  • 由于这个矩形位于报表标题部分,它将显示在所有报表页面上。

Thanks, Sufian.

谢谢你,服。

#5


5  

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.

我解决这个问题的方法是手动更改后面的代码(从菜单视图/代码)。下面的部分应该有许多对 ,因为行数在tablix中。在我的例子中, 比tablix中的行数多。另外,如果您使用“高级模式”(在“列组”的右边),那么“行组”后面的静态行数应该等于tablix中的行数。使它相等的方法是修改代码。

<TablixRowHierarchy>
      <TablixMembers>
        <TablixMember>
          <KeepWithGroup>After</KeepWithGroup>
          <RepeatOnNewPage>true</RepeatOnNewPage>
        </TablixMember>
        <TablixMember>
          <Group Name="Detail" />
        </TablixMember>
      </TablixMembers>
    </TablixRowHierarchy>

#6


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.

这样做和新的报告工作,我将比较2 .rdl文件在Visual Studio中。这些都是XML格式的,我希望一个快速的WindDiff或其他东西可以揭示问题所在。

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.

最初的外观显示,在两个文件之间有700行代码或更多的差异,其中2个是错误的文件。粗略地看一下TablixHeader标签并没有发现任何明显的信息。

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.

但在我的例子中,它是一个损坏的。rdl文件。这最初是从一个工作报告中复制的,因此在删除未被重用的内容的过程中,这可能会使它损坏。但是,在完成相同过程的其他报告中,当在属性中进行正确设置时,头文件可以重复。

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.

也许将已知好的XML文件与错误的XML文件进行比较会成为一个很好的论坛帖子。我这边也要试试。

#1


343  

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.

这取决于您使用的tablix结构。例如,在表中,您没有列组,因此Reporting Services不能识别哪些文本框是列标题,将RepeatColumnHeaders属性设置为True是无效的。

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.)
    • Tablix:在每个不工作的页面上重复标题行——报告构建器3.0
  2. 在分组窗格中打开高级模式。(单击列组右侧的箭头,选择高级模式)
  3. 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.
  4. 在行组区域(不是列组)中,单击一个静态组,它突出显示tablix中相应的文本框。单击每个静态组,直到它突出显示最左侧的列标题。这通常是列出的第一个静态组。
  5. In the Properties window, set the RepeatOnNewPage property to True.
    • Tablix:在每个不工作的页面上重复标题行——报告构建器3.0
  6. 在属性窗口中,将RepeatOnNewPage属性设置为True。
  7. Make sure that the KeepWithGroup property is set to After.
  8. 确保KeepWithGroup属性设置为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.

KeepWithGroup属性指定静态成员需要坚持到哪个组。如果设置为After,则静态成员将在组之后,或在组之下,充当组头。如果设置为Before,那么静态成员将与之前的组保持一致,或在其之上,作为组页脚。如果设置为None,那么Reporting Services将决定将静态成员放在何处。

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

现在,当您查看报表时,列标题会在tablix的每个页面上重复。

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

本视频展示了如何按照所描述的答案进行设置。

#2


12  

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:

我有2.0,并且找到了上面的帮助;但是,由于某些原因,静态选择没有突出显示单元格。我跟着这些步骤:

  1. Under column groups select the advanced and the statics will show up
  2. 在列组下,选择高级的和静态的
  3. Click on the static which shows up in the row groups
  4. 单击在行组中显示的静态。
  5. Set KeepWithGroup to After and RepeatOnNewPage to true
  6. 将KeepWithGroup设置为After,并将RepeatOnNewPage设置为true

Now your column headers should repeat on each page.

现在你的列标题应该在每个页面上重复。

#3


7  

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.

在行组区域(不是列组)中,单击一个静态组,它突出显示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
  • 设置KeepWithGroup后
  • set RepeatOnNewPage to True for repeating headers
  • 将RepeatOnNewPage设置为True用于重复标题
  • set FixedData to True for keeping headers visible
  • 将FixedData设置为True,以保持头可见。

#4


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.
  • 在报表“Header”部分中,在矩形中添加文本框,每个文本框将表示表的列标题。
  • As this rectangle is on the Reports Header section it will display on all report pages.
  • 由于这个矩形位于报表标题部分,它将显示在所有报表页面上。

Thanks, Sufian.

谢谢你,服。

#5


5  

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.

我解决这个问题的方法是手动更改后面的代码(从菜单视图/代码)。下面的部分应该有许多对 ,因为行数在tablix中。在我的例子中, 比tablix中的行数多。另外,如果您使用“高级模式”(在“列组”的右边),那么“行组”后面的静态行数应该等于tablix中的行数。使它相等的方法是修改代码。

<TablixRowHierarchy>
      <TablixMembers>
        <TablixMember>
          <KeepWithGroup>After</KeepWithGroup>
          <RepeatOnNewPage>true</RepeatOnNewPage>
        </TablixMember>
        <TablixMember>
          <Group Name="Detail" />
        </TablixMember>
      </TablixMembers>
    </TablixRowHierarchy>

#6


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.

这样做和新的报告工作,我将比较2 .rdl文件在Visual Studio中。这些都是XML格式的,我希望一个快速的WindDiff或其他东西可以揭示问题所在。

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.

最初的外观显示,在两个文件之间有700行代码或更多的差异,其中2个是错误的文件。粗略地看一下TablixHeader标签并没有发现任何明显的信息。

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.

但在我的例子中,它是一个损坏的。rdl文件。这最初是从一个工作报告中复制的,因此在删除未被重用的内容的过程中,这可能会使它损坏。但是,在完成相同过程的其他报告中,当在属性中进行正确设置时,头文件可以重复。

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.

也许将已知好的XML文件与错误的XML文件进行比较会成为一个很好的论坛帖子。我这边也要试试。