Note: Forums will be making significant UX changes to address key usability improvements surrounding search, discoverability and navigation. To learn more about these changes please visit the announcement which can be found HERE.
Can you set a chart series fill color to automatic via expression

Proposed Can you set a chart series fill color to automatic via expression

  • Saturday, September 22, 2012 8:55 PM
     
     

    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

     

All Replies

  • Sunday, September 23, 2012 10:58 PM
    Moderator
     
     Proposed

    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.

  • Monday, September 24, 2012 2:31 PM
     
     

    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

  • Monday, September 24, 2012 3:02 PM
     
     

    Hi,

    Give a try to this expression.

    =IIf(cbool(Fields!IsReference.Value)=true, "Green", "#00000000")


    Aftab Ansari

  • Monday, January 28, 2013 10:27 PM
     
     
    I got the same error, both "Automatic" and "#00000000" don't work for me, I'm using rdlc report viewer in VS2010