有没有办法比较 RDLC 报告中列中的两个单元格?

Is there a way to compare two cells in a Column in RDLC report?

我有一个可以包含重复值的 rdlc 报告列。喜欢

          Refno      value
cell1     c101       171.20
cell2     c102       150.20
cell3     c101       171.20
cell4     c101       171.20
cell5     c102       150.20

现在我想将 Refno 列中的每个单元格一个一个地相互比较。首先说我将采用 cell1 值 'c101' 并将其与 Refno 列中的每个其他单元格进行比较,以检查是否还有另一个 'c101'。我可以在 RDLC 中完成吗?

你为什么不使用这样的查询


select sum (distinct Refno)from tablename

不会显示列 refno 的重复

我有一个报告中汇总的点击序列(希望它有帮助)

首先按 Refno 分组

添加页眉或页脚行

点击详情行的行可见性,我用红圈标记了标志

将其设置为隐藏

现在您可以在 header/footer 行中使用求和函数

因此,您只有与 refno 值一样多的行

对于您的特殊情况,您需要在代码窗格中使用类似以下代码的内容

Public Shared table As System.Collections.Hashtable

Public Shared Function current(ByVal key As String, ByVal value As Decimal) As Decimal
    If table Is Nothing Then
        table = New System.Collections.Hashtable()
    End If

    If table.ContainsKey(key) Then Return 0D
    table.Add(key, value)
    Return value
End Function

并使用

=sum(Code.current(Fields!NewColumn0.Value,cdec(Fields!NewColumn1.Value)))

在您想要总和的字段中