SSRS 2008: Why are some legend item colors appearing in Black?


I've taken advice provided in a previous answer which has solved my original problem - avoiding "Series1" appearing in the legend.

I have also stored the group colour in the database, so that is now retrieved as part of my query and used in the series Fill expression.  This too is working as you can see by the bar colours in the attached chart.

My problem now is the legend seems to have the correct colour for the first group in the legend, but all of the others are black!  See the attached screenshots that show the data that is being returned by my query, and a chart of the question.  As you can see, the SME group was assigned to the NULL answer and with the same colour assignment.

Any thoughts on this issue?

Thanks for all of your assistance.


Query results
Bar chart showing legend with black instead of actual color
Who is Participating?
ValentinoVConnect With a Mentor BI ConsultantCommented:
I think it might have something to do with the fact that not all "GroupName" values are present in all question answers.

I have the impression that the legend gets build based on the first answer collection, in your case above that would be answer number 1.

Could you test this out by adding additional records for the missing GroupNames for answer 1?  If you set FinalScore to Null (or zero?) the effect on the chart should be minimal but hopefully the legend appears as expected...
ValentinoVBI ConsultantCommented:
Just wondering, could it be related to that NULL value for FinalScore?  Do you have a way to test the chart without that NULL value?
jlj30Author Commented:
I changed the data so that there were no NULL values for FinalScore, but the problem continues.
However, I get a slightly different result if I run the report against a different set of questions.
In the screenshot below, you'll see that the 1st two legend items have the correct colour; only the last two are black.
In reviewing all questions, I see only two like this; all others are all black with the exception of the first legend item (per my initial post).

Here's the chart and the accompanying query result set:

Chart with 1st two legend items correct; remaining ones black
Query Result set
By the way, based on a Google search I came across what I thought was the solution.
I changed Palette to be Custom, PalettePatternBehavior to None and defined my colors under CustomPaletteColors.
This had no effect.

Any suggestions as to what to try next?

Thanks in advance.

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

jlj30Author Commented:
Hi Valentino,

You were right.  Adding all groups to the 1st answer resulted in a correctly rendered legend.
But now what?  My simple query has already turned more complex, and it now looks like I'll need a stored procedure to deal with this situation.  I am going to try returning a row for each group that answered a question and associate each with the first answer.  

But this seems unnecessary.
Shouldn't SSRS be handling this?
Am I coding around a bug?

Any further thoughts?


PS: Perhaps a Guinness would help :)
ValentinoVBI ConsultantCommented:
It does indeed seem like a bug, unfortunately I wasn't able to reproduce it...  Perhaps it's worth checking if you've got all the latest Service Packs installed?  You'd need to install the SPs for both your SQL Server version and Visual Studio to be sure...
jlj30Author Commented:
I'll pursue the SPs.
Since you did provide me with a workaround that I'll need to develop (assuming the SPs do not fix it), I'm going to accept your solution.

jlj30Author Commented:
Thanks to Valentino for pointing me in the right direction.
ValentinoVBI ConsultantCommented:
Thanks Jim, hopefully the SPs do actually fix it though and otherwise there's still the Guinness ;)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.