Listbox: Applying Deselect All on rerun
There is a report where users can select multiple product lines from a listbox. When they rerun the report, the previous selection is remembered.
Users want the selection to be automatically cleared on re-run.
Getting ready
Select any existing report or create a new sample report that filters on Product Lines. Create a Listbox type of prompt for the product line. Set its multi-select property to Yes.
How to do it...
Wrap the listbox in a span similar to previous recipes; that is, create two HTML items around the listbox and define span A1.
Now define a new HTML item in prompt page footer as follows:
<script> var theSpan = document.getElementById("A1"); var a = theSpan.getElementsByTagName("A"); for( var i = a.length-1; i >= 0; i-- ) { var link = a[i]; if( typeof(link.id) == "string" && link.id.match(/PRMT_(SV|LIST)_LINK_DESELECT_/) ) {link.fireEvent("onclick");} } </script>
- Run the report for any product line. Then re-run the report...