Hello Team,
I have two prompts, one Radio button prompt and a Textbox prompt.
I need steps to clear the prompt values on report rerun. I am able to find the following script on line and added a HTML item with that code after the prompts in the prompt page but the prompt values are not getting cleared. Can you please let me know the steps and if required suggest me the changes to the script.
<script type="text/javascript">
function clearAllValues() {
var oCR = cognos.Report.getReport("_THIS_");
var aControls = oCR.prompt.getControls();
for (var i = 0; i < aControls.length; i++) {
aControls.clearValues();
}
}
</script>
<script>
window.onLoad=clearAllValues;
</script>
Thanks
The following works for me.
<script type="text/javascript">
var oCR = cognos.Report.getReport("_THIS_");
function clearAllValues() {
var aControls = oCR.prompt.getControls();
for (var i = 0; i < aControls.length; i++) {
aControls[i].clearValues();
}
}
oCR.onload = clearAllValues();
</script>