好!
我正在按表达式分组,但不能解决我的问题。我正在使用嵌入式代码函数来执行此操作,这使我怀疑是否可以在函数中使用变量(Dim Public var)来定义将如何分组。这些变量是在石斑鱼之前的实例中用值设置的。 在第一行中的tablix内部,我调用该函数:
= Code.SetearCodOrden (First (Fields! Codorden.Value, "Variables"))
在“组表达式”中,我将其定义如下:
= Code.Agrupador (Fields! Codctacte.Value, Fields! Cobcod.Value, Fields! Vencod.Value, Fields! Paiscod.Value, Fields! Prvcod.Value, Fields! Value.Value)
Dim Public codOrden As String
Public Function SetearCodOrden(ByVal CodOrden As String) As String
codOrden = CodOrden
return ""
End Function
Public Function ObtenerCodOrden() As String
return codOrden
End Function
Public Function Agrupador(ByVal Codctacte As String, ByVal Cobcod As String, ByVal Vencod As String, ByVal Paiscod As String, ByVal Prvcod As String, ByVal Valor As String) As String
If (StrComp(codOrden, "Clie") = 0) Then
return Codctacte
ElseIf (StrComp(codOrden, "Cobr") = 0) Then
return Cobcod
ElseIf (StrComp(codOrden, "Vend") = 0) Then
return Vencod
ElseIf (StrComp(codOrden, "Pais") = 0) Then
return Paiscod
ElseIf (StrComp(codOrden, "Prov") = 0) Then
return Prvcod
ElseIf (StrComp(codOrden, "Atrb") = 0) Then
return Valor
Else : return ""
End If
End Function