COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: xyz on 26 May 2014 05:27:29 AM

Title: Value prompt with multiselect option setting the background color is not workin
Post by: xyz on 26 May 2014 05:27:29 AM
Hi All,

We have a value prompt with multi select in our report, basically we are setting some white color as a background color for value prompt, the problem I am facing is the color adjacent to 'Select All' and 'Deselect All' text option under the value prompt is getting set white color as a background color, where we don't want white color to be displayed adjacent to 'Select All' and 'Deselect All' text. Please find the attachment of the image. If the value prompt is single select then it we are not facing as color issue adjacent to 'Deselect All' text.

How can we set the background color for multi select value prompt, adjacent to 'Select All' and 'Deselect All' to be user defined color instead of white?


Your help will be much appreciated :)

Thanks & Regards,
Xyz
Title: Re: Value prompt with multiselect option setting the background color is not workin
Post by: navissar on 26 May 2014 06:10:37 AM
Try adding this script after the prompts:
<script>
var allLinks=document.getElementsByTagName("a");
for(var i=0;i<allLinks.length;i++){
if(allLinks[i].className&&allLinks[i].className=="clsLink pl"){
allLinks[i].parentNode.parentNode.parentNode.parentNode.parentNode.style.backgroundColor="";
}
}
</script>

It's not pretty but it should get the job done on value lists.
Title: Re: Value prompt with multiselect option setting the background color is not workin
Post by: xyz on 26 May 2014 08:10:38 AM
Hi Nimrod,

Thank you very much for the reply, your help is much appreciated  :) the code provided in the below reply is not working for me. I am using Cognos 10.2.1 version.

Sorry, If I wasn't clear in what I have explained, please find the attached images what's currently happening and what is expected. Say suppose I placed value prompt with multi select inside a table cell and applied light blue color to table cell and white color as a background color to value prompt then color for value prompt is not displaying as expected. Please find the current output and expected output images attached with this email.


Thanks & Regards,
Xyz

Title: Re: Value prompt with multiselect option setting the background color is not workin
Post by: navissar on 26 May 2014 01:12:08 PM
Right, a checkbox. OK.
First, remove the white background you gave your prompt. Then, put an HTML item with <span id="ILoveCognos"> before (to the left of) your prompt, then another one after (To the right of) your prompt with:
</span>
<script>
var allDivs=document.getElementById("ILoveCognos").getElementsByTagName("div");
for(var i=0;i<allDivs.length;i++){
if(allDivs[i].className&&allDivs[i].className.indexOf("clsCheckBoxList")==0){
allDivs[i].style.backgroundColor="white";
break;
}
}
</script>

This will give a white background to the prompt box only, thus making you happy.
Title: Re: Value prompt with multiselect option setting the background color is not workin
Post by: xyz on 27 May 2014 12:31:12 AM
Hi Nimrod,

You are awesome man!!!

The piece of code provided by you, works like a piece of cake.



Thanks & Regards,
Xyz
Title: Re: Value prompt with multiselect option setting the background color is not workin
Post by: ersin.gulbahar on 09 Sep 2014 03:21:19 AM
Thanks Nimrod , it works fine for me.
Title: Re: Value prompt with multiselect option setting the background color is not workin
Post by: bladeless on 08 Sep 2015 02:50:15 PM
Why do you use "clsLink pl" here?
Do all links in a Cognos report use "clsLink pl" as className?