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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.

ValentinoVBI 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...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

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 ;)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.