COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: pankaj on 30 Jun 2015 09:08:32 AM

Title: every third row should be grey
Post by: pankaj on 30 Jun 2015 09:08:32 AM
i have alist report and i waana show the every third row of the list report grey .. according to the picture .. plz rply wth all possible steps remember that is is sectioned at location
Title: Re: every third row should be grey
Post by: RossBrown on 30 Jun 2015 09:57:32 AM
Add a Query Calculation to your query, call it something like 'GreyRows'.

You can use 'running-count' on one of your data fields to get a count of how many rows have appeared since the last subtotal for that item.

Then use the 'mod' function to test if you have hit a 3rd row.

so something like this:   mod(running-count([Location]),3)

That data item will now have a '1' in it whenever you want to highlight the row.

Now on your Report Page, highlight the list column body area wherever you would like the Highlighting to apply, select 'Conditional Styles' -> Advanced Conditional Style.

Name it 'Highlight 3rd Row'.  Click the button in the bottom left to create a new condition, and edit the new condition and select your 'GreyRows' data item, and test it against 1.

ie.  [qryMain].[GreyRows] = 1

Set the style on that condition to Background color gray.