COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Cognos Talk on 24 Apr 2014 01:19:59 PM

Title: conditional formatting to the list report v.10.2
Post by: Cognos Talk on 24 Apr 2014 01:19:59 PM
Hello
I tried to apply conditional formatting to the list report by creating a Boolean variable "Private type = 'No' "
On the list I go to the column, unlock the column and on the text select render variable and chose the variable that I created. By default it chooses 'Yes'. But on the output it hides all the column value even when the private type is private or not.   This technique worked successfully with another database as a source and with the same version of Cognos, but now I use sql server 2008.
I tried and used conditional style using advanced conditional style editor and used expression private type = 'Private' and in in advanced options choose box type none and it still didn't work.
Any idea?


Title: Re: conditional formatting to the list report v.10.2
Post by: jmills on 24 Apr 2014 05:37:45 PM
As a test, I would recommend adding the variable to your report to ensure that the output is indicating 'No'/'Private', to ensure your condition is valid.  I would be surprised if it were your data source.
Title: Re: conditional formatting to the list report v.10.2
Post by: Cognos Talk on 25 Apr 2014 07:45:47 AM
I actually just re-confirmed it re-creating sample conditional formatting suing other data source, it works ok with conditional variables for me.
I tried your suggestion and created another string variable, but it is not working at all. it runs the report but not hiding anything.
Any other ideas?
Thank you very much for your time and support,
Title: Re: conditional formatting to the list report v.10.2
Post by: MFGF on 25 Apr 2014 07:55:32 AM
Quote from: Cognos Talk on 25 Apr 2014 07:45:47 AM
I actually just re-confirmed it re-creating sample conditional formatting suing other data source, it works ok with conditional variables for me.
I tried your suggestion and created another string variable, but it is not working at all. it runs the report but not hiding anything.
Any other ideas?
Thank you very much for your time and support,

The only think I can think of is that your [Private type] column doesn't actually contain any instances of 'No' - maybe it has leading or trailing spaces you can't see?

MF.
Title: Re: conditional formatting to the list report v.10.2
Post by: Cognos Talk on 25 Apr 2014 08:00:50 AM
I created a filter using Private Type = 'Private' or Private Type = 'No' and it works fine, it is filtering data.
I just re-confirmed with DBA that there is not trailing spaces in data, and I also am able to take these values from available values in calculations or filter in Cognos. Any conditional formatting is not working at all. How can it be?
Title: Re: conditional formatting to the list report v.10.2
Post by: MFGF on 25 Apr 2014 08:40:42 AM
Quote from: Cognos Talk on 25 Apr 2014 08:00:50 AM
I created a filter using Private Type = 'Private' or Private Type = 'No' and it works fine, it is filtering data.
I just re-confirmed with DBA that there is not trailing spaces in data, and I also am able to take these values from available values in calculations or filter in Cognos. Any conditional formatting is not working at all. How can it be?

If it works with the sample data but not with your data, then it points to the data being the issue? As a sanity check, try building a complete new report from scratch with just the items you need to test the conditional rendering. That will rule out something else in your current report being the cause.

MF.
Title: Re: conditional formatting to the list report v.10.2
Post by: Cognos Talk on 25 Apr 2014 09:45:39 AM
Thank you for your reply.
I created a new report and when creating a Boolean variable I put expression private_type = 'No'. it created the variable and two values Yes and No, then I was thinking I have two values Yes and Private so I changed the private type column saying that if the value is "private' then put "yes'. It worked!!!! I am surprised how it worked before in another data source while having the same value Private and No. I guess Informix was treating this booolean variable as true or false or something like that and sql server treats it like actual values. Not sure, but infomix data works with not changing any values, as is and sql server doesn't. Not sure why it is happening.
Anyway it is works now.
thank you so much for all you helpful hints and timely support!