COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: dzuser on 12 Aug 2015 12:11:34 PM

Title: Report Studio 8.3: Reset a parameter trough javascript
Post by: dzuser on 12 Aug 2015 12:11:34 PM
Hi,
I want to filter a report trough a text prompt and javascript, selecting is Ok, but reseting the parameter is not working, also cognos.Report.getReport: is not available in 8.3, how can do it ?

below the code
<button title="Show Tab 1" onclick="document.formWarpRequest.elements['p_REGION_ID'].value='1';promptButtonFinish();document.formWarpRequest.elements['p_REGION_ID'].value='';">Select 1</button>
&nbsp;
<button title="Show Tab 2" onclick="document.formWarpRequest.elements['p_REGION_ID'].value='2';promptButtonFinish();">Select 2</button>
&nbsp;
<button title="Show Tab 2" onclick="clearAllValues() ;">RESET</button>


<input type="text" name="p_REGION_ID" value=""/>



<script>

function clearAllValues() {
   var oCR = cognos.Report.getReport("_THIS_");
   var aControls = oCR.prompt.getControls();
   for (var i = 0; i < aControls.length; i++) {
      aControls.clearValues();
   }
}

</script>