RDLC分组序号

1、RDLC报表表格中添加序号,调用表达式RowNumber( Nothing )

2、RDLC报表,表格分组后添加序号,分两种情况

第一种情况,在分组内添加从1开始的序号,每个分组内都是从1开始计数。

在报表属性-》代码中添加如下代码:

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

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

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

End Function

然后在需要添加序号的表格中添加表达式=Code.GroupCount(Fields!bm.Value)


第二种情况,分组外排序,即给组排序,从1开始,每多一个不同的分组添加1,有多少个不同的组,序号就增加到多少。

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

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

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

End Function

然后在需要添加序号的表格中添加表达式=Code.GroupCount(Fields!bm.Value)


其中方法一,在翻页的时候会重新从1开始计数,目前尚未解决,可以尝试将表格嵌套在矩阵中。

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值