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

Removing title/dotted line from value prompt when rerunning a report

Started by myersmar, 15 Nov 2010 10:50:03 AM

Previous topic - Next topic

myersmar

I need to remove the title and dotted line from a value prompt. I have the following Javascript in an HTML Item to do it:

<script>
var f = getFormWarpRequest();
var prompt = f._oLstChoicesX;
prompt.remove(1);
prompt.remove(0);
prompt.removeAttribute("hasLabel");
</script>

Note1: "X" is the name of the prompt specified in the value prompt properties.
Note2: I'm using Cognos 8.4 Report Studio

This script works perfectly the first time I run the report however, it only works the first time. If I rerun the report the title and dotted line reappear. Any suggestions to eliminate them as well on a rerun?

TIA,
Marcia

bioCam

Try this ..

<script language="javascript">

//your Value Prompt is your first Select object, if its the 2nd, change
  • -> [1]
    var list=document.getElementsByTagName("SELECT")[0];
    list.remove(1);
    list.remove(0);
    list.removeAttribute("hasLabel");
    list.options[0].selected = true;
    canSubmitPrompt();

    </script>

peritas-chris

Isn't it great that Cognos 10 makes this easy now?  It's just a property of the prompt object!

bloggerman

Awesome. Haven't seen 10 yet, but,sounds great.Script to do such trivial stuff was annoying.