Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Custom code erroring out Expand / Collapse
Author
Message
Posted Thursday, April 17, 2014 8:58 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Monday, August 25, 2014 2:32 PM
Points: 206, Visits: 451
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
Post #1562702
Posted Friday, April 18, 2014 12:31 PM This worked for the OP Answer marked as solution
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 6:58 AM
Points: 1,092, Visits: 2,328
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
Post #1563136
Posted Monday, April 21, 2014 7:06 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Monday, August 25, 2014 2:32 PM
Points: 206, Visits: 451
Yup, that was it. It runs successfully.

Thanks a lot!

John
Post #1563468
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse