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

Clear prompt values on report rerun using Javascript

Started by raja_krp, 15 Jun 2017 12:39:28 AM

Previous topic - Next topic

raja_krp

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

Stepharia

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>