Search code examples
reporting-servicesssrs-2008

SSRS Change Row Color for First Row of Sorting


I have a table that is sorted by Main Tank and would like to make the first row of each sort (where the name of main tank switches to a new tank) to be grey. So if you have 10 rows with only 2 tanks you would have two lines of gray, the first for each new tank. I though I could possibly use RunningValue for this but haven't been able to get that to work. Any suggestions on a function or method I could use for this?


Solution

  • I think you can achieve that checking if the current value is equal to the previous, in that case you set the background-color the color you want.

    I've used this table to test.

    enter image description here

    Select the row, in Background-color property use this expression:

    =iif(
    Fields!Tank.Value=previous(Fields!Tank.Value),
    "Transparent",
    "Red"
    )
    

    Replace "Red" for the color you want.

    It will produce something like this:

    enter image description here

    Let me know if this helps.