Can you set a chart series fill color to automatic via expression
I have a line chart which will contain a variable number of series depending on the report parameters. Currently it is using the default BrightPalette. The user may opt to include a reference series. I am trying to create an expression so that if the
series is a reference series it appears in green or else the color should be automatic.
The expression looks like this: =IIf(Fields!IsReference.Value,"Green",
"#00000000")
Unfortunately this does not work, the reference series is in green but the other series are not rendered on the chart. They appear in the legend but are not drawn in the chart area. If I change the expression to
=IIf(Fields!IsReference.Value,"Green",
"#ff000000") non reference series are rendered as black so I assume the the hex values is being parsed to an argb
and since the alpha channel is 0 nothing appears. Since in other context
"#00000000"
means automatic can you use automatic as part of an expression or is this not allowed?
Dave
September 22nd, 2012 5:17pm
Hi There
Thanks for your posting. I have tried in my test environment this expression and it is giving me expected result.
IIf(Fields!IsReference.Value,"Green",
"Automatic")
Or
IIf(Fields!IsReference.Value,"Green",
"#00000000")
Both works for me
Please right click on your graph and go to properties and try to choose color palette as bright Pastel and see if it make any difference
I hope this will help
Many Thanks
Syed Qazafi Anjum
Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful.
Free Windows Admin Tool Kit Click here and download it now
September 23rd, 2012 7:20pm
Hi Shahfaisal
Doesn't work for me :( My chart is a line chart but switching it to columns still shows the same behaviour.
Played around with using Nothing as well but no joy. The reference series is green all others are black.
=IIf(Fields!IsReference.Value, "Green",
Nothing)
I did find a similar post regarding this issue. It concerns a similar expression that used to work in SSRS 2005 but no longer works in SSRS 2008 (the version I am using) so I am guessing this functionality was removed.
http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/f2771fd6-b9b5-42fe-89ca-d626cc1a1a92/
Here is an SSRS 2005 article that describes exactly what I want to do. (See the section called "Custom Chart Color Palettes and Legends"). But I can't get it to work in SSRS 2008.
http://msdn.microsoft.com/en-us/library/aa964128(SQL.90).aspx#moressrscharts_topic3
Thanks for you help,
Dave
September 30th, 2012 10:29am
Hi,
Give a try to this expression.
=IIf(cbool(Fields!IsReference.Value)=true, "Green", "#00000000")Aftab Ansari
Free Windows Admin Tool Kit Click here and download it now
September 30th, 2012 10:59am