locked
Alternating background colour with alternating colour scheme by group RRS feed

  • Question

  • I'm building a report showing new starters at a company between two dates. This is then grouped by Department (e.g. Sales, Quality Control, IT, Warehouse etc)

    I've used the normal alternating background colour and have found this

    =iif(RunningValue(Fields!Name.Value,CountDistinct, Nothing) mod 2, "White", "whitesmoke")

    I've looked at ways of having all of the group in a single colour so IT would be white, Quality Control would be WhiteSmoke but I haven't got this working for some reason. I also think it might be better to have alternating colours within the group as the company can take on quite a lot of warehouse staff in a short period of time.

    I was wondering if it was possible to have the department field alternating between whitesmoke and aliceblue and then have the fields within these groups alternating between either shaded or unshaded with the matching shading for the department.

    As an added complication it would be good if the rows always alternated between shaded and unshaded across the groups so that you don't have one group ending in white and the next group starting in white. Has anyone done this?

    Thursday, January 29, 2015 2:13 PM

Answers

  • Hi AndyRL,

    Per my understanding that you want to specify the background color for an row group (Sales, Quality Control, IT, Warehouse) alternative with two colors and also need to alternative another two kinds of colors for the details information in the group.

    I have tested on my local environment and as you have mentioned that we can use below expression to alternative the background color for the Group:
    =IIF(RunningValue(Fields!Name.Value, CountDistinct, "DataSet1") mod 2,"White","whitesmoke")

    Using another expression to alternative colors for the details group within the row group:
    =IIF(RowNumber("RowGroupName") mod 2,"Green","Blue")

    Preview result:

    If your problem still exists, please provide the both snapshot of the layout you got after using the expression and the expect layout you expect, also give us sample data about the table if possible.

    Any problem, please feel free to ask.
    Regards
    Vicky Liu


    Vicky Liu
    TechNet Community Support


    • Proposed as answer by Vicky_Liu Thursday, February 5, 2015 1:03 AM
    • Marked as answer by Vicky_Liu Friday, February 6, 2015 2:01 AM
    Friday, January 30, 2015 9:31 AM

All replies

  • I've found a way to do this but don't like the results much. I added
    DepartmentOrder = Dense_Rank()Over(order by Department.Name)
    to my dataset

    Thursday, January 29, 2015 4:24 PM
  • Hi AndyRL,

    Per my understanding that you want to specify the background color for an row group (Sales, Quality Control, IT, Warehouse) alternative with two colors and also need to alternative another two kinds of colors for the details information in the group.

    I have tested on my local environment and as you have mentioned that we can use below expression to alternative the background color for the Group:
    =IIF(RunningValue(Fields!Name.Value, CountDistinct, "DataSet1") mod 2,"White","whitesmoke")

    Using another expression to alternative colors for the details group within the row group:
    =IIF(RowNumber("RowGroupName") mod 2,"Green","Blue")

    Preview result:

    If your problem still exists, please provide the both snapshot of the layout you got after using the expression and the expect layout you expect, also give us sample data about the table if possible.

    Any problem, please feel free to ask.
    Regards
    Vicky Liu


    Vicky Liu
    TechNet Community Support


    • Proposed as answer by Vicky_Liu Thursday, February 5, 2015 1:03 AM
    • Marked as answer by Vicky_Liu Friday, February 6, 2015 2:01 AM
    Friday, January 30, 2015 9:31 AM