BIRT多个子组

时间:2017-02-22 07:57:51

标签: report birt

我有一个关于birt多级分组的问题。我有一个返回以下内容的数据集:

    +---------+---------+---------+---------+---------+---------+
    | Column0 | Column1 | Column2 | Column3 | Column4 | Column5 |
    +---------+---------+---------+---------+---------+---------+
    | Data00  | Data11  | Data21  | Data    | Data    | Data    |
    +---------+---------+---------+---------+---------+---------+
    | Data00  | Data11  | Data21  | Data    | Data    | Data    |
    +---------+---------+---------+---------+---------+---------+
    | Data00  | Data11  | Data22  | Data    | Data    | Data    |
    +---------+---------+---------+---------+---------+---------+
    | Data00  | Data11  | Data22  | Data    | Data    | Data    |
    +---------+---------+---------+---------+---------+---------+
    | Data00  | Data12  | Data23  | Data    | Data    | Data    |
    +---------+---------+---------+---------+---------+---------+
    | Data00  | Data12  | Data23  | Data    | Data    | Data    |
    +---------+---------+---------+---------+---------+---------+
    | Data00  | Data12  | Data23  | Data    | Data    | Data    |
    +---------+---------+---------+---------+---------+---------+
    | Data00  | Data12  | Data23  | Data    | Data    | Data    |
    +---------+---------+---------+---------+---------+---------+

现在我需要创建一个包含多级分组的报告,该报告将给出如下所示的结果:

    +---------+---------+---------+---------+---------+---------+
    | Column0 | Column1 | Column2 | Column3 | Column4 | Column5 |
    +---------+---------+---------+---------+---------+---------+
    | Data00  | Data11  | Data21  | Data    | Data    | Data    |
    +         +         +         +---------+---------+---------+
    |         |         |         | Data    | Data    | Data    |
    +         +         +---------+---------+---------+---------+
    |         |         | Data22  | Data    | Data    | Data    |
    +         +         +         +---------+---------+---------+
    |         |         |         | Data    | Data    | Data    |
    +         +---------+---------+---------+---------+---------+
    |         | Data12  | Data23  | Data    | Data    | Data    |
    +         +         +         +---------+---------+---------+
    |         |         |         | Data    | Data    | Data    |
    +         +         +         +---------+---------+---------+
    |         |         |         | Data    | Data    | Data    |
    +         +         +         +---------+---------+---------+
    |         |         |         | Data    | Data    | Data    |
    +---------+---------+---------+---------+---------+---------+

我已经尝试过“Drop”和“Suppress duplicates”。除了删除组头之外,不可能的单元格也会丢失。该报告生成如下所示的数据,并在组标题上显示空单元格:

    +---------+---------+---------+---------+---------+---------+----------------------------------------+
    | Column0 | Column1 | Column2 | Column3 | Column4 | Column5 | Explanation                            |
    +---------+---------+---------+---------+---------+---------+----------------------------------------+
    | Data00  |         |         |         |         |         | <--Empty cells of group header Data00  |
    +         +---------+---------+---------+---------+---------+----------------------------------------+
    |         | Data11  |         |         |         |         | <--Empty cells of group header Data11  |
    +         +         +---------+---------+---------+---------+----------------------------------------+
    |         |         | Data21  |         |         |         | <--Empty cells of group header Data21  |
    +         +         +         +---------+---------+---------+----------------------------------------+
    |         |         |         | Data    | Data    | Data    |                                        |
    +         +         +         +---------+---------+---------+----------------------------------------+
    |         |         |         | Data    | Data    | Data    |                                        |
    +         +         +         +---------+---------+---------+----------------------------------------+
    |         |         |         | Data    | Data    | Data    |                                        |
    +         +         +         +---------+---------+---------+----------------------------------------+
    |         |         |         | Data    | Data    | Data    |                                                |
    +         +---------+---------+---------+---------+---------+----------------------------------------+
    |         | Data12  |         |         |         |         | <--Empty cells of group header Data12  |
    +         +         +---------+---------+---------+---------+----------------------------------------+
    |         |         | Data23  |         |         |         | <--Empty cells of group header Data23  |
    +         +         +         +---------+---------+---------+----------------------------------------+
    ...
    ...
    ...etc

是否可以像上面的第二个表一样使用丢弃单元格对数据进行分组?

1 个答案:

答案 0 :(得分:0)

  1. 将column0的分组应用于column2,然后删除除组头之外的所有行,并保留组头放置属性为详细信息。
  2. 对于具有1行1列的数据单元格插入表中的column3。
  3. 在该表插入组内。
  4. 在表达式组中为第3列的所有列提供“和条件”。在第3列表达式中的组,例如 row [“ column0”] && row [“ column1”] && row [“ column2”] && row [“ column3” ]
  5. 在目录中给出行[“ column0”]
  6. 按照上述步骤对column4和column5进行操作。删除表中除组头以外的其他行,并将column3的组头的drop属性保留为column5为空。