本文介绍了ReportViewer将矩阵报表合并的单元格导出到Excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Microsoft ReportViewer在本地模式下开发报告(RDLC).这是一个矩阵报告(有些人可以将其称为交叉表报告).例如,矩阵表可能包含3个用于城市人口的列:

-----------------------------------
州级城市人口
-----------------------------------
TX休斯敦3000000
TX达拉斯1500000
CA洛杉矶3500000
CA旧金山2500000
-----------------------------------

但是,ReportViewer将多个状态值分组到一个合并的单元格中,如下所示:

-----------------------------------
州级城市人口
-----------------------------------
TX休斯敦3000000
达拉斯1500000
CA洛杉矶3500000
旧金山2500000
-----------------------------------

导出到Excel后,Excel中的单元格也会合并.有没有一种方法不合并第一列?顶部表格的格式是我想要的,而不是底部表格.

我正在使用VS 2010 SP1,VB,.NET Framework 3.5 SP1.
希望有人可以解决,或者可以告诉我这是当前的限制.

在此先感谢您.

I am developing a report (RDLC) using Microsoft ReportViewer in local mode. It is a matrix report (some may call this a crosstab report). For example, the matrix table may have 3 columns for populations of cities:

-----------------------------------
State city Population
-----------------------------------
TX Houston 3000000
TX Dallas 1500000
CA Los Angeles 3500000
CA San Francisco 2500000
-----------------------------------

However, ReportViewer groups multiple values of states into one merged cell like so:

-----------------------------------
State city Population
-----------------------------------
TX Houston 3000000
Dallas 1500000
CA Los Angeles 3500000
San Francisco 2500000
-----------------------------------

When exported to Excel, the cells in Excel are also merged. Is there a way not to have the first column merged? The format of the table on the top is what I want, not the bottom one.

I am using VS 2010 SP1, VB, .NET Framework 3.5 SP1.
Hope someone can have a solution, or can tell me that this is a current limitation.

Thanks in advance.

推荐答案


<TablixRowHierarchy>
  <TablixMembers>
    <TablixMember>
      <Group Name="Level_Block_Name">
        <GroupExpressions>
          <GroupExpression>=Fields!Level.Value</GroupExpression>
          <GroupExpression>=Fields!Block.Value</GroupExpression>
          <GroupExpression>=Fields!Name.Value</GroupExpression>
        </GroupExpressions>
      </Group>
      <SortExpressions>
        <SortExpression>
          <Value>=Fields!Level.Value</Value>
        </SortExpression>
        <SortExpression>
          <Value>=Fields!Block.Value</Value>
        </SortExpression>
        <SortExpression>
          <Value>=Fields!Name.Value</Value>
        </SortExpression>
      </SortExpressions>
      ...


这篇关于ReportViewer将矩阵报表合并的单元格导出到Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 08:14