05. Groups

Unknown macro: {scrollbar}

This section defines content that will print for each group defined on the report. The tag encapsulates all groups. This tag helps to keep parsing simple. If no groups are defined, a default group is created and contains all elements of the report data row.

A fields list may only contain strings defining the names of the items which form a group. This is not limited to items from the data model, you may also enter expressions here.

If you define a subgroup, then you'll have to include all fields of the parent group and at least one new field. The field is not required to exist. If the field does not exist during the report processing, the value 'null' is used as replacement for the field's content.

The group ordering is defined by the contents of the <fields> tag of the groups. A less specific group is printed before any more specific group. A group is considered more specific than an other group, if it contains more fields in its field list.

Report Section

XML Syntax

Description

Groups

<groups>
</groups>

There can be one or more groups definitions in the "groups" element. If no groups are defined, a default group is created to contain all data elements of the current report.

Group

<group></group>

Defines a group inside a groups element. (A group has a uniqe name and a list of fields.

Group Header

<groupheader>
</groupheader>

Prints as the header for a group.

Group Footer

<groupfooter>
</groupfooter>

Prints as the footer for a group

Example of Groups

The text below is sample data

1ST GROUP BY
BEGIN <first group by A>
    2ND GROUP BY
    BEGIN <second group by A.a>
      <details>
    2ND GROUP BY
    END <second group by A.a>
    2ND GROUP BY
    BEGIN <second group by A.b>
      <details>
    2ND GROUP BY
    END <second group by A.b>
1ST GROUP BY
END <first group by A>
1ST GROUP BY
BEGIN <first group by B>
    2ND GROUP BY
    BEGIN <second group by B.a>
      <details>
    2ND GROUP BY
    END <second group by B.a>
    2ND GROUP BY
    BEGIN <second group by B.b>
      <details>
    2ND GROUP BY
    END <second group by B.b>
1ST GROUP BY
END <first group by B>
<groups>
  <group name="FIRST GROUP ">
    <fields>
      <field>FIRST_GROUP_COLUMN_FIELD</field>
    </fields>
    <groupheader height="36" font="Arial" fontsize="10">
      <label height="18" alignment="left" width="100%" x="0" y="0">1ST GROUP BY</label>
      <message\-field height="18" alignment="left" width="100%" x="0" y="18">
        BEGIN $(FIRST_GROUP_COLUMN_FIELD)
      </message-field>
    </groupheader>
    <groupfooter height="36" font="Arial" fontsize="10">
      <label height="18" alignment="left" width="100%" x="0" y="0">1ST GROUP BY </label>
      <message-field height="18" alignment="left" width="100%" x="0" y="18">
        END $(FIRST_GROUP_COLUMN_FIELD)
      </message-field>
    </groupfooter>
  </group>
  <group name="SECOND GROUP ">
    <fields>
      <field>FIRST_GROUP_COLUMN_FIELD</field>
      <field>SECOND_GROUP_COLUMN_FIELD</field>
    </fields>
    <groupheader height="36" font="Arial" fontsize="10">
      <label height="18" alignment="left" width="90%" x="10%" y="0">2ND GROUP BY</label>
      <message-field height="18" alignment="left" width="90%" x="10%" y="18">
        BEGIN $(SECOND_GROUP_COLUMN_FIELD)
      </message-field>
    </groupheader>
    <groupfooter height="36" font="Arial" fontsize="10">
      <label height="18" alignment="left" width="90%" x="0" y="0">2ND GROUP BY</label>
      <message-field height="18" alignment="left" width="90%" x="10%" y="18">
        END $(SECOND_GROUP_COLUMN_FIELD)
      </message-field>
    </groupfooter>
  </group>
</groups>

Detailed Header/Footer Attribute Pages