Search code examples
.netsql-serverreporting-servicesssrs-2008bids

SSRS BIDS 2008 Alternating Background Colours when Grouped by


Can anyone help with an expression to alternate the colors between records under 'Service'. The report is GROUPED BY 'Service'.

I have tried =IIF(RowNumber(Nothing) Mod 2, "Silver", "White") previously however I think the GROUP BY is causing an issue here and cannot find a clear solution.

enter image description here


Solution

  • Use:

    =IIF(RunningValue(Fields!Service.Value,COUNTDISTINCT,NOTHING) MOD 2 = 0, "Green","Red")
    

    Set this expression in that box in your SS and you should be fine.

    If you want to go even more in-depth and get crazy with your coloring, check out this blog post on advanced grouping and coloring.