为RDLC 报表分组添加序号

RDLC就一个RowNumber的函数能用来做序号,但是往往我们更需要的是分组序号 在RDLC中, 只能用vb 来写。

代码如下:

Dim count As Integer
Dim GroupName As String
Public Function GroupCount(name As String) As Integer

If (GroupName = "") Then
count = 1
GroupName = name
GroupCount = count
Exit Function
End If

If (GroupName = name) Then
count = count + 1
Else
GroupName = name
count = 1
End If

GroupCount = count

End Function

调用 : Code.GroupCount(Fields!GroupName.Value);

 

posted @ 2013-01-11 13:39  ◇゛   仅此而已  阅读(1432)  评论(0编辑  收藏  举报