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

Show or Hide any Element in cognos 10.2.2 report studio

Started by aravind006, 04 Feb 2016 03:08:55 AM

Previous topic - Next topic

aravind006

Hi,

Please let me the code for to Show or Hide any Element in the cognos 10.2.2, using Javascript.


Thanks ,
Aravind

BigChris

Wouldn't you be better with render variables? Javascript is prone to getting broken with new releases etc.

afzaki7

Hi,

Surround the element with two HTML one before it and one after

put in the first HTML

<div id="myDIV" >

and for the other HTML

</div>


then from java-script we will set (style="display:none" ) to the div

so add another HTML in and put code like that


<script>
function hideElelment()
{
document.getElementById("myDIV").style.display = "none";
}
</script>
<button type="button" onclick="hideElelment();" > Click Me!</button>


" إِذَا مَاتَ ابْنُ آدَمَ انْقَطَعَ عَمَلُهُ إِلا مِنْ ثَلاثٍ : مِنْ صَدَقَةٍ جَارِيَةٍ ، أَوْ عِلْمٍ يُنْتَفَعُ بِهِ ، أَوْ وَلَدٍ صَالِحٍ يَدْعُو لَهُ "

bdbits

While javascript will work, I'd have to agree with BigChris that you should avoid using it if there is a native, out-of-the-box way to accomplish the same thing.

MFGF

Also bear in mind that when you move to Cognos Analytics (Cognos 11), JavaScript is not supported at all when the viewer is in interactive mode. Why would you code your way into a blind alley like this when there are suitable alternatives that will continue to work?

MF.
Meep!