I have a Report with a group, each group has some different rows. Using RowNumber([group_name])
will return the last row number in the group and RowNumber(nothing)
will return the row number running through all the rows in the group. I want to have some kind of RowNumber
which returns the group number instead.
For example, here is the sample table in the report:
//This is grouped by Name
Order Name Item
------------------------------------------
1 A Item 1 of A
Item 2 of A
------------------------------------------
2 B Item 1 of B
Item 2 of B
Item 3 of B
------------------------------------------
3 C Item 1 of C
------------------------------------------
4 D Item 1 of D
The above table is what I want, however if using RowNumber("NameGroup")
for the column Order
, the result will be:
Order Name Item
------------------------------------------
2 A Item 1 of A
Item 2 of A
------------------------------------------
3 B Item 1 of B
Item 2 of B
Item 3 of B
------------------------------------------
1 C Item 1 of C
------------------------------------------
1 D Item 1 of D
If using RowNumber(nothing)
for the column Order
, the result will be:
Order Name Item
------------------------------------------
2 A Item 1 of A
Item 2 of A
------------------------------------------
5 B Item 1 of B
Item 2 of B
Item 3 of B
------------------------------------------
6 C Item 1 of C
------------------------------------------
7 D Item 1 of D
Preparing data for the Order
column is OK but I want to use some support of Local Report for this kind of work (numbering the row). In fact, I want to number the group in this case, not the row. How can I resolve this?
You could look at using the RunningValue function for this, something like:
=RunningValue(Fields!Name.Value, CountDistinct, "DataSet1")
You might have to play with the Scope parameter to get the correct Scope for your desired results.