How to Get Auto-Submit in a Cognos Multi-Select Prompt
June 28, 2016 1 Comment
This week, we had a report that we wanted to function like an Active Report, but we couldn’t use Active Reports because the report prompts would have resulted in hundreds of thousands of charts being generated. So we were forced to use Report Studio.
To make it look like an Active Report, we would have the drop-down value prompts auto-submit, so each change in the prompt would re-submit the report and change the chart. However auto-submit does not work for multi-select value prompts, so we had to get creative. The solution was to wrap the multi-select value prompt in a div tag with an onmouseup event. To implement this, add an HTML item before the multi-select value prompt and set it’s source to this:
<div id="cbPrompt1" onmouseup=" setTimeout(function(){ var inputs =getElementById('cbPrompt1').getElementsByTagName('INPUT'); for (var i =0; inputs.length > i; i++) { inputs[i].disabled=true; } promptAction( 'reprompt' ); }, 50); "> |
Then add an HTML item after the prompt to close the div tag:
<div> |
That’s all there is to it! When the user clicks on an option they want to select the mouse-up is triggered. This first disables the prompts to prevent users who click very fast from selecting another option (which would be ignored), and then it triggers a re-prompt..
Of course, only use this technique on reports that run quickly, otherwise it could be very frustrating for your users.