COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: blue8 on 17 Dec 2009 06:13:43 PM

Title: Conditional formatting - Font Color - problem !HELP!
Post by: blue8 on 17 Dec 2009 06:13:43 PM
I need to conditionally change the value of a number in a column based on this condition -

The user enters a numeric value - for example 100 (I have set up a Parameter with a Text Box Prompt for this).  This value is not used to filter anything on the report.

This value is to be used to conditionally change the color of the font to green if the number (sales) is above this 100.  So if the user enters 500, then if the value of the sales is over 500, then it should show up in green.

I am having problems doing this.

Could the problem be because the parameter is a text value? 

How can I do this?

Thanks!!!
Title: Re: Conditional formatting - Font Color - problem !HELP!
Post by: MFGF on 18 Dec 2009 08:17:06 AM
You can get it to work, but it requires a few steps:

1. Add a data item to your query (call it Threshold) with the expression cast(?Threshold?,integer)
2. Define a boolean variable with the expression [Query1].[Your item to be conditionally formatted] >= [Query1].[Threshold] (don't worry if it does not validate at this point).
3. Select your list column to be conditionally highlighted and define your Boolean variable in the Style Variable property.  Fron Condition Explorer, select the 'Yes' value and set the colour of the column to be green.
4. Select the entire list, and in the Properties property, enable the Threshold item as a property of the list.
5. Define a text box prompt that uses your Threshold variable.

MF.