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

RS - Set a value into a Value Prompt

Started by hsu29, 25 May 2007 05:35:40 AM

Previous topic - Next topic

hsu29

Tool: Report Studio. Cognos 8.2

Hi

I have a "Value Prompt" with the collection of recent years: 2004, 2005, 2006, 2007.
and want to assign the current year as the default value for that object.


How could I do that?
If it's via Javascript code, Where could I find the list of objects\methods that we can use within a report?

Thanks a lot

goose

You can use this javascript

var Cognos = {
  Dropdown: '_oLstChoices',
  Textbox:  '_textEditBox'
}

var Form = {
  Control: function (name) {
    return document.getElementById(Cognos.Textbox + name)
      ||   document.getElementById(Cognos.Dropdown + name)
      ||   document.getElementById(name)
      ||   false;
  }
}



Example usage (You must name the control in Report Studio, here 'year' is the name):

alert(Form.Control('year').value;