In a report I've value prompt (YTD, QTD, MTD)
when I run the report it has to display automatically YTD
please share your ideas
Use a html item and javascript to auto select the prompt values.
<script language = "javascript">
document.forms["formWarpRequest"].elements["_oLstChoices<fieldname>"].selectedIndex = 2;
</script>
Where <fieldname> is the name of the prompt under properties, name.
Check cognos document:
http://support.cognos.com/knowledgebase/googlesearch?load_kb_document=1&dr=kb1&uniqueid=114497
This code is valid in 8.2 and earlier but apparently not in 8.3... does anyone have updated syntax for 8.3??
That's interesting...
So it doesn't work in 8.3?
We don't have 8.3 yet, so no help here...
Thanks for the reply
I got this to work in 8.3...
document.formWarpRequest._oLstChoicesPromptControlName.options[2].selected = true
... which selects the first value row (Row 3) in the list (row 1 is the item name and the row 2 is dashes)
I believe once the control is used, its name gets changed to some random value, making the code good only on initial render.