1. Overview
This document is about how to add filter option in classic report in oracle apex.
2. Technologies and Tools Used
The following technologies have been used to wrap the PLSQL code.
- Oracle Apex
3. Use Case
Let us have the requirement on how to add filter option in classic report.
4. Steps with Screenshot
Step 1:
Create a Classic Report with one text field type page item in your page.
The Above screenshot will help for better understanding.
Step 2:
Go to the Classic Report attributes section and find appearance CSS classes then add SEARCH_RECORD class there. The Following screenshot will help for the better understanding.
Step 3:
Go to the page (execute when page loads) section and put the following JavaScript code.
JavaScript Code:
$(document).ready(function(){
//change with your page item name
$(‘#P5_SEARCH’).keyup(function(){
var search = $(this).val();
$(‘.SEARCH_RECORD tbody tr’).hide();
var len = $(‘.SEARCH_RECORD tbody tr td:contains(“‘+search+'”)’).length;
if(len > 0){
$(‘.SEARCH_RECORD tbody tr td:contains(“‘+search+'”)’).each(function(){
$(this).closest(‘tr’).show();
});
}
});
});
$.expr[“:”].contains = $.expr.createPseudo(function(arg) {
return function( elem ) {
return $(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;
};
});
The Following screenshot will help for better understanding.
Output: