ssrs报表中如何生成序号

How to generate sequence numbers in ssrs report

我想在 ssrs 报告中生成序列号,如下图所示。

是否可以在 ssrs 报告中生成这些数字?

您可以在每个组 header 中插入 RowNumber(Nothing)。希望对你有帮助。

参考:如何添加每组header - http://www.sqlcircuit.com/2013/08/ssrs-how-to-implement-alternate.html

最初向您的 table 添加一列,它将存储行号的计算并将其隐藏

您可以对每个组使用 RunningValue 和 DistinctCount 以获得组号。

表达式如下(标题、组、类别、标题)

= 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")

您的数字列表达式将如下所示(textbox1 包含标题的行号,textbox16 包含组,...)

= 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