SSRS Trick to add Row Number in Report Layout RowNumber(scope)


Current Case if we use below function.

RowNumber(scope)
Parameters
scope
(
String) The name of a dataset, data region, or group, or null (Nothing in Visual Basic), that specifies the context in which to evaluate the number of rows. Nothing specifies the outermost context, usually the report dataset.


Wrong output of SR No


Actual Method 

You can easily achieve this with a little bit of vbcode. Go to Report - Properties - code and type something like:

Dim rownumber = 0 Function writeRow()
rownumber = rownumber + 1
return rownumber
End Function
Then on your cell, call this function by using =Code.writeRow()






Final out put of visual Code


Comments