locked
How to Alternate Row Background Color in SQL Server Reporting Services Tablix on Grouping row without Details Row in Tablix RRS feed

  • Question

  • Hello SSRS MVPS

    In the tablix If there is no Details row and Tablix is having multiple Groupings and in this case how do I apply Alternate Row Background Color atleast for one grouping.

    Please let me if theres is solution or fix.

    Thanks in Advance 
    Saturday, May 9, 2015 5:36 AM

Answers

  • Hi,

     You can use the below expression for alternate color, you dont need details rows for coloring.

    =iif(runningvalue(<field value>,COUNTDISTINCT,"<group name>") mod 2,"#e8f6f9","white")

     Since I am not completely sure of your report layout, you can debug this by using a column which will have the runningvalue(<field value>,COUNTDISTINCT,"<group name>"). so every odd color is white and even number is #e8f6f9.

    Regards,

    Bharath R S

    Sunday, May 10, 2015 3:40 PM
  • Hi Mahesh,

    According to your description, you want to create alternate row color for the report, right?

    In your scenario, you could use RowNumber() function to retrieve the order of the row then set the background color or use RunningValue() function. For more information, please refer to this article: Alternate Row Color for SSRS Report With Column Group.

    If issue persists, please share report design and expected results.

    If you have any question, please feel free to ask.

    Best regards,
    Qiuyun Yu


    Qiuyun Yu
    TechNet Community Support


    Monday, May 18, 2015 12:04 PM

All replies

  • Hi,

     You can use the below expression for alternate color, you dont need details rows for coloring.

    =iif(runningvalue(<field value>,COUNTDISTINCT,"<group name>") mod 2,"#e8f6f9","white")

     Since I am not completely sure of your report layout, you can debug this by using a column which will have the runningvalue(<field value>,COUNTDISTINCT,"<group name>"). so every odd color is white and even number is #e8f6f9.

    Regards,

    Bharath R S

    Sunday, May 10, 2015 3:40 PM
  • Hi Bharath,

    The above logic appears to work however when I tried am getting an error saying on the back ground expression aggregate cannot be applied.

    Example : DepartId is unique and grouping name is done DepartmentName

    so when I apply the expression as below

    =iif(runningvalue(<field value>,COUNTDISTINCT,"<group name>") mod 2,"#e8f6f9","white")

    =iif(runningvalue(DepartId ,COUNTDISTINCT,"DepartmentName") mod 2,"#e8f6f9","white")

    Please let me know if this approach is correct or not . else request you share a sample rdl when that logic works,

    Thanks in advance

    Mahesh 


    rg.mahesh2006@gmail.com

    Saturday, May 16, 2015 9:34 AM
  • Hi Mahesh,

    According to your description, you want to create alternate row color for the report, right?

    In your scenario, you could use RowNumber() function to retrieve the order of the row then set the background color or use RunningValue() function. For more information, please refer to this article: Alternate Row Color for SSRS Report With Column Group.

    If issue persists, please share report design and expected results.

    If you have any question, please feel free to ask.

    Best regards,
    Qiuyun Yu


    Qiuyun Yu
    TechNet Community Support


    Monday, May 18, 2015 12:04 PM