Adding Custom Code in SSRS Chart Report

  • Hi

    I am working on SSRS chart report.I am trying to add Custom color palatte to report

    For this i am using below code

    Private colorPalette As String() = {"Green", "Blue", "Red", "Orange",

    "Aqua", "Teal", "Gold", "RoyalBlue", "MistyRose", "LightGreen",

    "LemonChiffon", "LightSteelBlue", "#F1E7D6", "#E16C56", "#CFBA9B"}

    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

    I copied it from below MSDN link

    http://msdn.microsoft.com/en-us/library/aa964128.aspx

    Code is giving below error

    [BC42104] Variable 'c' is used before it has been assigned a value. A null reference exception could result at runtime.

    Please help me to rectify this.

Viewing 0 posts

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