When grouping in BIRT, we frequently want the grouping value to show up on the first line as follows:
Group User Reputation
------ --------------- ----------
Admins Bill The Weasel 51,018
Mark Grovel 118,101
Users Pax_my_bags_got_to_go 73,554
Jon Scoot **,***,*** <- overflow
Clueless 92,928
The normal way of acheiving this is to lay out the group in the designer as follws:
+---------+--------+--------------+
Tbl Hdr | Group | User | Reputation |
+---------+--------+--------------+
Grp Hdr | [Group] | | |
+---------+--------+--------------+
Grp Dtl | | [User] | [Reputation] |
+---------+--------+--------------+
Grp Ftr | | | |
+---------+--------+--------------+
Tbl Ftr | | | |
+---------+--------+--------------+
which, unfortunately, lays out the data in exactly that way, with the grouped value on a different line:
Group User Reputation
------ --------------- ----------
Admins
Bill The Weasel 51,018
Mark Grovel 118,101
Users
Pax_my_bags_got_to_go 73,554
Jon Scoot **,***,*** <- overflow
Clueless 92,928
This is particularly painful with data where there's lots of groups with only one user since we use twice as much space as needed. If we move the [Group]
data item down to the Grp Dtl
line, we get it printed for every line in the group.
How, in BIRT, do we merge the two lines Grp Hdr
and the first Grp Dtl
?
Grouped data are data formed by aggregating individual observations of a variable into groups, so that a frequency distribution of these groups serves as a convenient means of summarizing or analyzing the data.
At the bottom of the details page, click in the Sorting button and then Add... a new sort key. This will open a dialog box similar to creating a new Data element. Now BIRT will sort records based on the value passed by the if/else statement and not by the alphabetically listing of the group header.
The answer below was Mystik's original answer but, try as I might, I couldn't get it to work properly (though I didn't try the second suggestion so it may well work). That may be caused by the fact that I'm running a back level of BIRT (and, no, I'm not allowed to upgrade unfortunately, it's part of a separate product that has its own release cycles).
The solution I eventually found was to leave the data value in the grouping line and select the cell (not the data value), then set the Drop
control under Properties
, General
to be Detail
rather then the default None
.
This brings the data value down to the detail line when rendering the report.
And I'm editing this answer rather than adding my own since I don't want to be a rep whore :-)
Try following these steps:
In the advanced list, you will see a property called "Suppress Duplicates". Make this true for the column with the Group data in it and you will be all set.
Supress
Duplicates
+---------+--------+--------------+
Tbl Hdr | Group | User | Reputation |
+---------+--------+--------------+
Grp Hdr | | <-delete this row AFTER Group Creation
+---------+--------+--------------+
Grp Dtl | [Group] | [User] | [Reputation] |
+---------+--------+--------------+
Grp Ftr | | | |
+---------+--------+--------------+
Tbl Ftr | | | |
+---------+--------+--------------+
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With