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

 

Value prompt with multiselect option setting the background color is not workin

Started by xyz, 26 May 2014 05:27:29 AM

Previous topic - Next topic

xyz

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

navissar

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.

xyz

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


navissar

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.

xyz

Hi Nimrod,

You are awesome man!!!

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



Thanks & Regards,
Xyz

ersin.gulbahar


bladeless

Why do you use "clsLink pl" here?
Do all links in a Cognos report use "clsLink pl" as className?