MrsMope987
Programmer
- Sep 27, 2007
- 23
I'm using SSRS 05 to report on a progress database via ODBC connection through MS Access. There is a field in the dataset I'm using that is formatted like this (1;1;1;1;1;1;1;1). Each value is a month worth of sales, I need to split this field for viewing in a matrix control. I've got a small VBA function I wrote in MSAccess that works fine but I don't know how to use this same function in SSRS. I've added the function to the custom code in SSRS but I'm not able to reference it in the query; I should I don't know how to reference it in the query. I've tried to reference it from within the matrix control but continue to get errors:
Function:
[red]matrix cell contents (trying to pull July's data)[/red]
Function:
Code:
Public Function getElem(str as String, delim As String, N As Integer)
Dim myArr as Array
myArr = Split(str, delim)
If N >= 1 And N <= (1 + UBound(myArr)) Then
getElem = Trim(myArr(N - 1))
Return Cdbl(getElem)
End If
End Function
[red]matrix cell contents (trying to pull July's data)[/red]
Code:
=Code.getElem(First(Fields!peramt.Value, "dsIncomeStmt"),";",7)