SSRS how can I mark the data in color?

asked 2020-09-29T16:46:59.417+00:00
Artur Bogusławski 21 Reputation points

I have report:

Number of columns and their names are different.
I want mark color on the data which are not the same between columns.


SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,092 questions
No comments
{count} votes

3 answers

Sort by: Most helpful
  1. answered 2020-09-30T02:07:16.27+00:00
    ZoeHui-MSFT 18,671 Reputation points Microsoft Employee

    Hi @Artur Bogusławski ,

    From the data sample, the data you want mark color is used in the matrix.

    I don't think it's possible to meet the requirement from SSRS side.

    If you are using the table, we could easily meet your needs in background color with "=IIF(Fields!Column1.Value = Fields!Column2.Value,Nothing,"yellow")".

    With matrix data, it seems there is no method to solve the issue.

    You may need to change the framework of your report or abandon your needs.



    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

  2. answered 2020-09-30T06:21:58.25+00:00
    Olaf Helper 25,476 Reputation points

    Additional see MSDN Expression Examples (Report Builder and SSRS) => Decision Functions => 2nd - 4th example

    No comments

  3. answered 2020-10-02T07:03:21.127+00:00
    Artur Bogusławski 21 Reputation points

    I'm snowed under :-(.
    But I try use Your proposition. At the moment I see problem with:

    "The BackgroundColor expression for the text box ‘ILOSCI’ refers to the field ‘Column1’. Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope. Letters in the names of fields must use the correct case."

    SQL is very simle:

    dbo.REC_WERSJE.PRD_NUMER, (Main number)
    dbo.REC_WERSJE.PRD_NAZWA, (Main name)
    dbo.REC_WERSJE.PRD_KARTA, (Main card number)
    dbo.REC_WERSJE.PRD_ILOSC, (Main quantity)
    dbo.REC_WERSJE.SKL_NUMER, (Number ingredient)
    dbo.REC_WERSJE.SKL_NAZWA, (Name ingredient)
    dbo.REC_WERSJE.SKL_ILOSC AS ILOSCI, (Quantity ingredient)