Wednesday, July 6, 2016

How to Show the Serial Number in Reports Automatically Using Expression

Using expressions you can add Serial Numbers to reports automatically. i used adventureworks database
 if you want reproduce same scenario use below query in dataset 

SELECT FirstName+MiddleName+LastName as Fullname ,PersonType fROM [Person].[Person] where MiddleName is not null

Check below image to add serial number expression in ssrs report
Paste this expression =RowNumber(nothing) and click ok


Preview the report.



If you want to run your serial numbers based on columns data use below expression


=RunningValue(Fields!YourColumnName.Value, CountDistinct, "Dataset")