Custom code erroring out

  • I created a public function under custom code in an SSRS report, but when I run it, it returns the following error msg. I've looked and looked but can't figure out what's causing it. Hopefully someone sees what I'm doing wrong.

    "There is an error on line 5 of custom code: [BC30203] Identifier expected."

    Below is my code:

    Private colorPalette As String() = {"#77ACD1", "#7FC57F", "#FFB16D", "#BEA3D7", "#A59D93", "#B8341B", "#352F26", "#F1E7D6", "#E16C56", "#CFBA9B", "#E85756", "#FFC924"}

    Private count As Integer = 0

    Private mapping As New System.Collections.Hashtable()

    Public Function.GetColor(ByVal groupingValue As String) As String

    If mapping.ContainsKey(groupingValue) Then

    Return mapping(groupingValue)

    End If

    Dim c As String = colorPalette(count Mod colorPalette.Length)

    count = count + 1

    mapping.Add(groupingValue, c)

    Return c

    End Function

  • Well this sort of worked for me, I actually did not run it, but got no issues when I removed the period. This

    Public Function.GetColor(ByVal groupingValue As String) As String

    to this:

    Public Function GetColor(ByVal groupingValue As String) As String

  • Yup, that was it. It runs successfully.

    Thanks a lot!

    John

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply