none
RDLC Chart series color from int ARGB value RRS feed

  • Question

  • Hi,

    I m using an SQL db via Entity Framwork where I store sensors data and respective colors for charts, unfortunately the color is stored in my DB as a Int value.  I use Linq to retrieve data from DB and send them to an RDLC report, but RDLC chart object seems to only accept strings as Series Color value (like "Red", "Black", etc...). So I try to convert the color back to name using System.Drawing.Color.FromArgb(MyColor)

    Unfortunately if you try System.Drawing.Color.FromArgb(System.Drawing.Color.Red.ToArgb()).Name this does not return "Red" but "ffff0000" such value that RDLC Chart series doesn't accept as a color value...

    Please help.

    Thanks in advance

    Pascal.

     

    Tuesday, July 26, 2011 12:38 PM

Answers

  • Hi,

     The solution is in fact simple, you just need to add a # in front of the color.name.

    So in my case : 

    String ColorName ="#"+ System.Drawing.Color.FromArgb(65532).Name
    

     

    Hope that it's help.

    Rgds 

    Pascal.


    Thursday, August 18, 2011 1:09 PM