COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: k2 on 23 Jun 2008 10:49:20 AM

Title: Java Script for removing Prompt name and Dotted lines in 8.3
Post by: k2 on 23 Jun 2008 10:49:20 AM
Hi All,

Currently, i am working on 8.3 and looking for the Java script to remove prompt name and the dotted line as well in the Value prompt. Kindly some one help me out. Cheers

¬K 2
Title: Re: Java Script for removing Prompt name and Dotted lines in 8.3
Post by: Gopinath on 23 Jun 2008 11:04:22 PM
<script language='javascript'>
document.formWarpRequest._oLstChoicesX.remove(0);
document.formWarpRequest._oLstChoicesX.remove(0);
</script>

Replace X with the prompt name from the code
Title: Re: Java Script for removing Prompt name and Dotted lines in 8.3
Post by: k2 on 24 Jun 2008 03:32:46 AM
Thanks for the reply Gopi. I have tried that it works in 8.2 but not in 8.3. The following script works fine in 8.3 in the promprt page but not in the report page. Can any one help me out in this. Thanks

1. Add an HTML item to the left and right of the value prompt in the Report Studio

2. For the first HTML item (left) add '<span id = "A1">'

3. For the second HTML item (right) add '</span>'

4. Add an HTML item at the bottom of the prompt page next to "Run" button

5. Add the following script for the third HTML item:

<script type="text/javascript">

                var theSpan = document.getElementById("A1");
                var theSelect = theSpan.getElementsByTagName("select");
                theSelect[0].options[2].selected=true; //This will make default value in prompt to be the first item after line, change the value '2' for other item
                theSelect[0].options[0].text = '<PUT WHATEVER TEXT FOR VALUE PROMPT TITLE HERE>';

                canSubmitPrompt();

</script>

6. The value "A1" can be anything you like. Run the Report.

Regards,
K 2
Title: Re: Java Script for removing Prompt name and Dotted lines in 8.3
Post by: TEL on 08 Sep 2008 05:56:59 AM
Hi Guys,

Is there any way to set a default selection?

Thanks

Nigel
Title: Re: Java Script for removing Prompt name and Dotted lines in 8.3
Post by: kattaviz on 11 Sep 2008 01:39:02 PM
Hi,

If u know the index of the default value u can do that through the following script.
----------------------------
listBoxXXX.selectAll();
document.getElementById('formWarpRequestRS')._oLstChoicesXXX.options[2].selected=true;
----------------------------

HTH,

Satish Katta