0
votes

I have a report like below.

Report Imaage

I have only one parameter in the Report i.e Year.

If the user choose an year, I need to display the data for the selected Year & Previous year.

In the database level I am capturing the previous year and displaying the data for selected & Selected -1 year.

I am keeping the Year on the series fields. so the data looks like above Image.

But I need to display different colors for the p1 - 2013 & p1 - 2014.

I am choosing color from series properties. When I choose "Automatic" I am getting diff colors for each bar, But I was not able to choose my custom colors for each bar.

Color Selection Property

Is it possible to get different colors ?

1
How are you currently selecting the colors? Using a built-in theme? Choosing your own custom colors? Directly choosing the fill?mmarie
@mmarie choosed my custom colors...Roshan
Can you post info on your colors? Where how did you choose them?mmarie
@mmarie - Sorry for the delay. I have added the screenshot.Roshan

1 Answers

0
votes

I wrote a function like below and I have called the function in my fill property..

Private colorPalette As String() = {"#1f497d","#c00000", "SteelBlue", "Coral"}
    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

Calling the above function

=Code.GetColor(Fields!colname.Value)