COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: balu on 08 Dec 2010 04:12:52 AM

Title: How to remove first 2 rows from value prompt
Post by: balu on 08 Dec 2010 04:12:52 AM
Hi All,

    I have created one value prompt on products,at run time it's displying like first row as parameter name and second row as hash lines and third row onwards products information,but my client doesn't need first two rows.so please anybody help me how to remove first two rows from value prompt with complete procedure.


Thanks in Advance..

Regards,
Balu.
Title: Re: How to remove first 2 rows from value prompt
Post by: kattaviz on 08 Dec 2010 02:55:39 PM
Hi,

Use the following javascript in the prompt page where "Prompt1" is your value prompt name.

<script language="javascript">
var f = getFormWarpRequest();
var list = f._oLstChoicesPrompt1;
list.remove(1);
list.remove(0);
list.options[0].selected = true;
</script>

Title: Re: How to remove first 2 rows from value prompt
Post by: MM4I on 09 Dec 2010 02:04:17 AM
hi Kattaviz,

I've placed an html item with the code before the value prompt, but it doesn't work.
Is there anything else I need to do?
We're using 8.4

Kind regards
MM4I
Title: Re: How to remove first 2 rows from value prompt
Post by: kattaviz on 14 Dec 2010 03:13:39 PM
Hi MM4I,

try placing the HTML after the prompt (after the finish button).
Title: Re: How to remove first 2 rows from value prompt
Post by: peritas-chris on 23 Dec 2010 10:00:00 AM
Upgrade to Cognos 10, there are new properties for prompts that allow you to remove those first two lines, parameter and -------------.  You'll love it!
Title: Re: How to remove first 2 rows from value prompt
Post by: nachmanb on 18 Sep 2011 03:24:31 AM
Chris,
Where is the property to remove the first 2 rows?
Title: Re: How to remove first 2 rows from value prompt
Post by: kalyanapu on 19 Sep 2011 07:29:22 PM
In Cognos 10 we do not need to write the java script.after Draging the "value prompt "into the promt page use the data item for that promt ( Example Account Code for Use Item and Account Name for Display Item:

Then select the Value Prompt , under value prompt properties , goto the " PROMPT TEXT " property , and select the " Header text " option and choose the " Specified Text " .Here you can put the custom text what ever you want to see in the run time.

or If you want to see the Default value for that Value Prompt , under value Prompt Properties you can choose the default value option and choose the default one.

Its really good one in Cognos 10.1 version.try with other options.

But if you want to remove the 1st 2 rows in cognos 8 series , we have to write the Javascript code.

:

Steps :

1.take one Value Prompt ( Use Prodcut Line code and Product Line as Use Item and Display Item )
2.Name the Value Prompt as " S" ( for example)
under miscellaneous property.
3. Drag One HTML Item right side of the Value Prompt.
4. Insert the code like below.

<script language="javascript">

var objRowRemove = fW._oLstChoicesS;
objRowRemove .remove(1);
objRowRemove .remove(0);
objRowRemove .removeAttribute('hasLabel');

</script>

click ok and run the report.

Thats all...
( Let me know if you are encountring any issue.)
We do not need to write Java Script for this one in Cognos 10 version.

Best Regards,
Srinivas Kalyanapu