Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » How to display the group index ?
How to display the group index ? [message #663467] Tue, 05 April 2011 08:45 Go to next message
RWIL Mising name is currently offline RWIL Mising nameFriend
Messages: 30
Registered: February 2011
Member
Hi,

I've a report with a list of row grouped by a criterion. I would like to display the group "index" in the group header, something like :

1) group A
line a
line b
2) group B
line c
3) group C
line d
line e

I don't know how to get the group index. The "row[0]" (row number) cannot be used, because it's the row index, not the group index. I've also tried to use Total.runningCount() or Total.runningSum() but it's not working neither.

I know I could create a counter var by script at the beginning of the list, increase the value on the onCreate() of each group header, and display the value of the counter, but I would like to do this without using script.

Any idea ?
Re: How to display the group index ? [message #663669 is a reply to message #663467] Wed, 06 April 2011 06:59 Go to previous messageGo to next message
Jani  is currently offline Jani Friend
Messages: 14
Registered: April 2011
Junior Member
I have used an aggregate with a function RUNNINGCOUNT that counts another aggregate. Do you get an idea from this code snippet ?

                <structure>
                    <property name="name">GroupTotalCustomers</property>
                    <property name="dataType">integer</property>
                    <simple-property-list name="aggregateOn">
                        <value>CreditGroup</value>
                    </simple-property-list>
                    <property name="aggregateFunction">COUNT</property>
                    <list-property name="arguments">
                        <structure>
                            <property name="name">Expression</property>
                        </structure>
                    </list-property>
                </structure>
                <structure>
                    <property name="name">GroupRunningCount</property>
                    <property name="dataType">integer</property>
                    <property name="aggregateFunction">RUNNINGCOUNT</property>
                    <list-property name="arguments">
                        <structure>
                            <property name="name">Expression</property>
                            <expression name="value" type="javascript">row["GroupTotalCustomers"]</expression>
                        </structure>
                    </list-property>
                </structure>

This way I have managed to get a running count of groups. Then you can map the running count to the values you need.
Re: How to display the group index ? [message #663720 is a reply to message #663467] Wed, 06 April 2011 10:16 Go to previous message
RWIL Mising name is currently offline RWIL Mising nameFriend
Messages: 30
Registered: February 2011
Member
Hi Jani,

It's working, thanks.
It would be easier to have a groupnum or something like that, but I'm happy to have a solution without javascript.

Regards

Previous Topic:Master-Detail with different levels
Next Topic:Birt Source code
Goto Forum:
  


Current Time: Thu Apr 25 20:31:32 GMT 2024

Powered by FUDForum. Page generated in 0.02829 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top