Crystal Reports & SQL Reporting Services Training Consultants
Account Log in:
Username:
Password:
Be open to new ideas
 
Institute of IT Trainers - Freelance Trainer of the Year 2006 & 2009
Liverpool Business Connect Member
  Maximum Impact Solutions Limited - Reporting Solutions, Creating Answers
Reporting Solutions - Creating Answers, Crystal Reports, Dashboarding (Xcelsius) & SQL Reporting Services

The Maximum Impact Solutions Blog Feed ME!!!!

21
July

How Do I Change the Default Chart Palette Colours in SQL Reporting Services 2005?

Recently a client asked how do I change the default colours of the SQL Server Reporting Services 2005 (SSRS 2005) chart palette?

They wanted to know how to create the following pie chart palette:
  • Completed - Lime Green
  • Ready - Green Yellow
  • In Progress - Yellow
  • Not Progressed- Red
  • Unknown - Blue
SQL Server Reporting Services 2005 chart object colour palette comes in seven flavours:
  • Default
  • Earth Tones
  • Excel
  • Gray Scale
  • Light
  • Pastel and
  • Semi - Transparent

This causes an issue for developers who want and/or require more flexibility in the choice of colours for the chart colour palette.

One method would be to add some code to the report, defining the colour palette for the chart, and then applying the code.

An alternative method is to use the SWITCH function.  The Switch function evaluates a list of expressions and returns an Object value corresponding to the first expression in the list that is True.

To create a custom palette based on the following values:

  • Completed - Lime Green
  • Ready - Green Yellow
  • In Progress - Yellow
  • Not Progressed- Red
  • Unknown - Blue
  1. In the Layout Tab of SSRS 2005, add the Chart Object to the grid.

  2. Click and drag the required fields to the required chart locations

  3. Right Click on the Chart Object Select Properties option
      
    This activates the Chart Properties dialog box:

    SQL Server Reporting Services 2005 Chart Properties dialog box

     
  4. In the Chart Properties dialog box, click on the Data Tab

  5. Select the required field in the Values: section

    SQL Server Reporting Services Chart Data Options dialog box


  6. Press the Edit button

  7. In the Edit Chart Value dialog box, select the Appearance Tab

    SQL Server Reporting Services 2005 Edit Chart Value dialog box


  8. Press the Series Style button

  9. In the Style Properties dialog box, select the Fill tab

    SQL Server Reporting Services 2005 Style Properties dialog box


  10. Press the [fx] button

  11. In the Edit Expression dialog box enter the following formula:

    =Switch(Fields!CaseStatus.Value="Complete","LimeGreen",

    Fields!CaseStatus.Value="Ready","GreenYellow",

    Fields!CaseStatus.Value="In Progress","Yellow",

    Fields!CaseStatus.Value="Not Progressed","Red",

    Fields!CaseStatus.Value="Unknown","Blue")


    SQL Server Reporting Services 2005 Edit Expression dialog box

  12. Press the OK button

If you have any questions, or need any assistance, please do not hesitate to Contact Us

MAKE A COMMENT

Name *

Email Address *

Comment *

To prove you are human what is:

54 + 82 =