Business Case:
User wants a clickable link on the prompt page to clear all prompt selections.
Environment: Cognos 8.4, Report Studio, Javascript, Mozilla Firefox / Internet Explorer
Implementation:
This can be achieved using Javascript.
User wants a clickable link on the prompt page to clear all prompt selections.
Environment: Cognos 8.4, Report Studio, Javascript, Mozilla Firefox / Internet Explorer
Implementation:
This can be achieved using Javascript.
- Place an HTML item at the end of the prompt page after all the prompts.
- Place the code from the next section into the HTML item.
- You can use a table to position the link on the page.
- When the report is executed, user will see a link "Clear All Selections", which will reset all the prompt selections.
<script>
var list_prompts = document.getElementsByTagName("select");
function ClearSelections(){
for (var i=0;i<list_prompts.length;i++)
{
list_prompts[i].selectedIndex = -1;
}
}
</script>
<a href="JavaScript:ClearSelections()">Clear All Selections</a>
Thanks for the solution sriram it worked with 8.4 as well as 10.1. Great work.
ReplyDeleteWinson.
Hi Sriram,
ReplyDeleteThis only works for the value from prompt.
How about if you have a check box value prompt it seems like it does not work with that.
Could you please post something which will clear the values from the check box multi-select value prompt.
I will really appreciate it.
Thanks
did you manage to get a solution for the checkbox?
DeleteGreat blog - thanks!
ReplyDeleteHow can we make this work for search & select prompt
ReplyDeleteThanks Sriram.
ReplyDeleteThis is great. Is there a way to modify this code for 2 value prompts. If one value prompt is selective, the other prompt reset/clear.
ReplyDeleteI will greatly appreciate it.
The lure of transforming one's body into something truly enviable along with other immediate gains of performance leads many people to steroids side effects.visit site
ReplyDeletethanks for this usefull article, waiting for this article like this again. napsgear
ReplyDelete