Search code examples
reporting-servicesssrs-2008ssrs-2012

How to generate sequence numbers in ssrs report


I want to generate sequence numbers in sssrs report as given in following image.

enter image description here

Is it possible to generate these numbers in ssrs report?


Solution

  • Initially add a column to your table which will store the calculation of the row number and make it hidden

    You can use RunningValue with DistinctCount for each group in order to get the group number.

    The expression will be like those below (heading, group, category, title)

    = RunningValue(Fields!heading.Value, CountDistinct, "DataSet1")
    = RunningValue(Fields!groups.Value, CountDistinct, "table1_Group1")
    = RunningValue(Fields!category.Value, CountDistinct, "table1_Group2")
    = RunningValue(Fields!title.Value, CountDistinct, "table1_Group3")
    

    Your number column expression will look like those below (textbox1 contains the row number for heading, textbox16 for groups, ...)

    = ReportItems!textbox1.value
    = Reportitems!textbox1.Value & "." & Reportitems!textbox16.Value
    = Reportitems!textbox1.Value & "." & Reportitems!textbox16.Value & "." & Reportitems!textbox22.Value
    = Reportitems!textbox1.Value & "." & Reportitems!textbox16.Value & "." & Reportitems!textbox22.Value & "." & Reportitems!textbox4.Value
    

    enter image description here

    enter image description here