SSRS how can I mark the data in color?

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

I have report:
29149-2020-09-29-14h41-50.png

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

29196-2020-09-29-14h37-33.png

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,878 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. ZoeHui-MSFT 35,556 Reputation points
    2020-09-30T02:07:16.27+00:00

    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.

    Regards,

    Zoe


    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. Olaf Helper 43,246 Reputation points
    2020-09-30T06:21:58.25+00:00

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

    0 comments No comments

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

    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:

    SELECT DISTINCT
    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)
    dbo.REC_WERSJE.DATA AS OKRES (Date)

    FROM
    dbo.REC_WERSJE
    WHERE
    dbo.REC_WERSJE.PRD_NUMER IN (@INDESK_REC)