﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Discuss Content Posted by Raj Vasant / Article Discussions / Article Discussions by Author  / Adding Custom Code in SSRS Chart Report / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Mon, 20 May 2013 18:57:31 GMT</lastBuildDate><ttl>20</ttl><item><title>Adding Custom Code in SSRS Chart Report</title><link>http://www.sqlservercentral.com/Forums/Topic669930-227-1.aspx</link><description>Hi I am working on SSRS chart report.I am trying to add Custom color palatte to reportFor 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 FunctionI copied it from below MSDN linkhttp://msdn.microsoft.com/en-us/library/aa964128.aspxCode 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.</description><pubDate>Thu, 05 Mar 2009 22:09:14 GMT</pubDate><dc:creator>shilpadixit</dc:creator></item></channel></rss>