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

How to remove first 2 rows from value prompt

Started by balu, 08 Dec 2010 04:12:52 AM

Previous topic - Next topic

balu

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.

kattaviz

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>

thanks & regards
Satish Katta

MM4I

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

kattaviz

Hi MM4I,

try placing the HTML after the prompt (after the finish button).
thanks & regards
Satish Katta

peritas-chris

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!

nachmanb

Chris,
Where is the property to remove the first 2 rows?

kalyanapu

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