If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Displaying different colors for alternate rows

Started by dipesh_mistry, 03 Oct 2007 08:23:34 AM

Previous topic - Next topic

dipesh_mistry

Hi All,
I have a list report in which I want to display the records  fetched into two different colors in the list.Please suggest.

Regards,
dipsy

almeids

This is a fairly common technique which you should find described in the ReportNet forums, FAQs, or Cognos' Knowledge Base.

MFGF

Hi,

Almeids is correct - this is a well-known technique.  The basics are:

1. Add a query calculation containing a running-count summary eg running-count([Order_no])
2. Add a second query calculation as follows: mod([First calc],2)
3. Set up a boolean variable in the condition explorer with the expression [Second calc] > 0
4. Select 'list columns body style' using the Select Ancestor button, select the Style Variable property, and pick your boolean variable.
5. Hover your mouse over the Condition Explorer, select the 'Yes' variable value, then set the Background Colour property.  Using the condition explorer, switch to the 'No' variable value and repeat using a different colour.
6. If your calculations exist in the query but are not shown in the list, select the list using the Select Ancestor button, go to the Properties property, and enable the calculations as properties of the list.

Regards,

MF.
Meep!

dipesh_mistry

Hi,
Thanx for the reply...
Actually i have implemented dynamic sorting in my reports.... so whenever i click on any of the columns of the list report the  order of the color becomes uneven.... i.e. alteranate colors for the rows is not maintained.
Any suggestions on this plz.....

Regards,
dipsy

MFGF

Depends... How did you implement your dynamic sorting?

MF.
Meep!

nosub

Have you tried using RowNumber() report expression as opposed to running-count?

dipesh_mistry

Hi,
Its not allowing me to use RowNumber() in a dataitem.

Regards,