Excel

Saturday, July 9, 2011

SSRS - Serial number for the group column

                We were developing a report which contain a group (grouped by Product) and the group contain a detail row in it. We wanted to show Serial Number for the Products, we trying to use RowNumber function in SSRS but it didn’t come up as expected.  Finally we found the solution from Web which was written by Bilal Hani- a Microsoft Community Contributor as how to “add serial number to grouping column in SSRS Tablix”.

1. Open the report properties (right click on blank area outside the layout and click properties) or (Menu-->Report-->Report Properties)
2. Click on the code pane on the left
3. In the code window enter below script
Dim Counter as integer=0
public function getGroupCounter() as Integer
 Counter=Counter+1
 return Counter
end function
4. Go to the properties of the group (based on which group you need the group serial number)
5. Click the variables tab on the left
6. Click on Add and set Name as GroupCountValue and set the expression (in the expression window) as =Code.getGroupCounter, click ok and close the window.
7. Now in the textbox where you want to display the group number, set the expression as =Variables!GroupCountValue.Value
                Now the report will return the Serial Number for each Product as Expected. !!

2 comments:

  1. use this expression in text box to run serial numbers automatically

    =RowNumber(nothing)

    Running Serial Number Change

    ReplyDelete
  2. I think about it is most required for making more on this get engaged CBD

    ReplyDelete