Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RowNumber for group in SSRS 2005

I have a table in a SSRS report that is displaying only a group, not the table details. I want to find out the row number for the items that are being displayed so that I can use color banding. I tried using "Rowcount(Nothing)", but instead I get the row number of the detail table.

My underlying data is something like

ROwId   Team      Fan

1       Yankees   John
2       Yankees   Russ
3       Red Socks Mark
4       Red Socks Mary
...         
8       Orioles   Elliot
...         
29      Dodgers   Jim
...
43      Giants    Harry 

My table showing only the groups looks like this:

ROwId   Team
2       Yankees
3       Red Socks   
8       Orioles
29      Dodgers 
43      Giants  

I want it to look like

ROwId   Team
1       Yankees
2       Red Socks   
3       Orioles
4       Dodgers 
5       Giants  
like image 420
FistOfFury Avatar asked Jul 10 '13 21:07

FistOfFury


People also ask

How do you group in Tablix?

In a tablix data region, click in the table, matrix, or list to display the Grouping pane. Drag dataset fields to the Row Group and Column Group pane to create parent or child groups. Right-click an existing group to add an adjacent group.

How do I find the row number in SSRS report?

Just right click on Name column then navigate to Insert Column then select Left. Once you select left, you will see a New blank column is added before the Name column. After that, right click on newly added column then select Expression (fx) from context menu.


Video Answer


1 Answers

You can do this with a RunningValue expression, something like:

=RunningValue(Fields!Team.Value, CountDistinct, "DataSet1")

DataSet1 being the name of the underlying dataset.

Consider the data:

enter image description here

Creating a simple report and comparing the RowNumber and RunningValue approaches shows that RunningValue gives your required results:

enter image description here

like image 154
Ian Preston Avatar answered Sep 30 '22 04:09

Ian Preston