locked
How to set a color out of database values? RRS feed

  • Question

  • User-1400240815 posted

    Hello, everyone,

    I'm searching for a good hint for the following:

    In a LocalReport (rdlc) a duty roster shall appear. It's a pivot table; so no big thing.

    According to the kind of duty the cell shall set it's background color to a value that is stored in the database as HTML color value.

    I can't find any hint on how to set the so described color. I was appreciated about any help.

    Regards
    Joerg Pauly

    Saturday, July 15, 2017 3:38 PM

Answers

  • User-1400240815 posted

    Hello,

    I found it myself:

    Color is written as a 24 bit hex value in a string column.
    I just need to Trim() the value, put a leading "#" to it and give it to the BackgroundColor property like that:

    = "#" + Trim(Fields!Color.Value)


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 17, 2017 4:32 PM

All replies

  • User347430248 posted

    Hi Joerg Pauly,

    you can try to write expression like below.

    =iif(me.value<10,"Red","Green")
    

    it is just for an example, you can ty to change it according to your requirement.

    Reference:

    Changing Background colour in RDLC Files Cell dynamically

    Regards

    Deepak

    Monday, July 17, 2017 8:58 AM
  • User-1400240815 posted

    Hello,

    I found it myself:

    Color is written as a 24 bit hex value in a string column.
    I just need to Trim() the value, put a leading "#" to it and give it to the BackgroundColor property like that:

    = "#" + Trim(Fields!Color.Value)


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 17, 2017 4:32 PM