Skip to main content



      Home
Home » Archived » BIRT » Row number and group row number
Row number and group row number [message #139054] Fri, 03 March 2006 12:27 Go to next message
Eclipse UserFriend
Originally posted by: dave.gross.logiclibrary.com

Is there a way to:
1. Get the current row number from a table/list
2. Get the current row in the current group

#1 would be useful to toggle the background color of rows (light, dark,
light).

For #2, I want to hide redundant data for the group rows after the first
row. E.g., given a company name/contact name data set with values:

ACME|Contact1
ACME|Contact2
IBM|Contact3

I want to hide "ACME" from the second row, when grouped by company name.

If the current row in the group is > 1, I could use that to hide the cell.

Thanks,
-- Dave
Re: Row number and group row number [message #139068 is a reply to message #139054] Fri, 03 March 2006 13:28 Go to previous messageGo to next message
Eclipse UserFriend
Use this expression to give you the current row number with the current
group:
Total.runningSum(1)

You can also supply the optional GroupLevel parameter to the function (like
with all BIRT aggregates) to calculate the row# within a different group
level, or within the whole table. For example, "Total.runningSum(1, null,
0)" gives you the row # within the entire table regardless of whether the
expression appears in.

--
Gary Xue
Actuate Corporation - Product Development
BIRT Committer

"Dave Gross" <dave.gross@logiclibrary.com> wrote in message
news:du9u9e$gtd$1@utils.eclipse.org...
> Is there a way to:
> 1. Get the current row number from a table/list
> 2. Get the current row in the current group
>
> #1 would be useful to toggle the background color of rows (light, dark,
> light).
>
> For #2, I want to hide redundant data for the group rows after the first
> row. E.g., given a company name/contact name data set with values:
>
> ACME|Contact1
> ACME|Contact2
> IBM|Contact3
>
> I want to hide "ACME" from the second row, when grouped by company name.
>
> If the current row in the group is > 1, I could use that to hide the cell.
>
> Thanks,
> -- Dave
>
>
>
Re: Row number and group row number [message #139079 is a reply to message #139068] Fri, 03 March 2006 14:05 Go to previous message
Eclipse UserFriend
Originally posted by: dave.gross.logiclibrary.com

Thanks for the tip, Gary.

But imperically, I found that:
Total.runningSum(1)
gives the current row in the whole table (same as
Total.runningSum(1,null,0))

And
Total.runningSum(1,null,1)
will give you the row number in the current group.

It would be nice to add some of these examples to the doc on Total, or
simply an explanation of what values are possible for filter and group,
since I wouldn't have thought of null, for example.

Thanks,
-- Dave
Previous Topic:Category Series Interactivity
Next Topic:adding dynamic images
Goto Forum:
  


Current Time: Wed Nov 05 07:46:50 EST 2025

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

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

Back to the top