Custom Search

Tuesday, June 10, 2008

Cognos 8- Java script for removing query item name from value prompts

In Cognos 8, when value prompts are used, query item name comes at first, then a dotted line and then values start.

If user doesn't want to see the query item name and dotted line, it can be removed by using Java script.

To achieve this follow below steps-

1. Insert an HTML item just before the value prompt.

2. Write in HTML item. (Here "sample_span" is the id of the
span which can be changed.

3. Insert another HTML item just after the value prompt.

4. Write
in it. (It is actually the closing tag of the previous HTML tag.)

5. Now insert another HTML item in the footer of the prompt page.

6. Write following Java Script in it

var theSample = document.getElementById("sample_span");

// Replace "sample_span" by the id given in step 2.

var theSelectSample = theSample.getElementsByTagName("select");

theSelectSample[0].remove(0);

theSelectSample[0].remove(0);

//2 removes are used to remove query item name and dotted line from value
//prompt

1 comment:

shiv said...

Hi,

I have to do some modifications like removing query item n dotted line.But i was not able to do by reading ur blog , since i got bit confused abt where to write "sample_span" and that java script.

Actually i wrote sample_span and java script in PROPERTIES-->HTML for each HTML .when i runned report it was visible in report alond with query item and dotted line.

plz help me by giving specifically where i need to write............

regards,
shiv