Step-1:
=====
Create Classic/IR Report For Master. (Department List)
SQL Query :
Select A.DEPARTMENT_ID, A.DEPARTMENT_NAME, NVL(B.QTY,0) QTY, A.DEPARTMENT_ID report
FROM DEPARTMENTS
Step-2:
=====
Create Item : P9_DEPT_ID_FOR_EMP_LIST
And
Create Classic/IR Report For Details. (Department Wise Employee List)
SQL Query :
select EMPLOYEE_ID, DEPARTMENT_ID, FULLNAME, EMAIL
From EMPLOYEES
where department_id= :P9_DEPT_ID_FOR_EMP_LIST
Item to submit : P9_DEPT_ID_FOR_EMP_LIST
Step-3:
=====
Select Region Department Wise Employee List.
Create Dynamic action: EMP_LIST_REFRESH
Type : After Refresh
Selection Type : Region
Region : Department Wise Employee List.
Code :
var vThis = gThis;
var vTRID = $(vThis).attr("data-deptno3");
var vColSpan = $(vThis).closest("tr").find("td").length;
var vClass = $(vThis).closest("td").attr("class");
var vTR = $(vThis).closest("tr");
var vReportHTML = $('#penetails').clone();
vReportHTML = $(vReportHTML).removeAttr("id");
vReportHTML = $(vReportHTML).css("display", "block");
var vReportHTMLFinal = $('<div>').append($(vReportHTML)).html();
$(vTR).after('<tr id="penetails_'+vTRID+'" class="my_custom_row2" style="display: none;"><td class="'+vClass+'" colspan="'+vColSpan+'" style="padding: 15px;">'+vReportHTMLFinal+'</td></tr>');
$('tr.my_custom_row2').show(500);
Select Region -->
Region Static ID : penetails
Custom Attributes : style="display: none"
Step-4:
=====
Select Master Report Column
Type : Link
Target : Type : URL
URL : javascript: void(0);
Link Text : <span class="fa fa-materialized-view" aria-hidden="true"></span>
Link Attributes : class="viewAdk" data-deptno3="#REPORT#"
Step-5:
=====
Create Dynamic Action on Click Event.
Action Name: Show_EMP_list
Selection Type : jQuery Selector
jQuery Selector : .viewAdk
True Action : Execute JavaScript Code
Code : $('tr.my_custom_row2').hide(500, function(){$(this).remove();});
gThis = $(this.triggeringElement);
Again True Action : Set Value
Type : JavaScript Expression
JavaScript Expression : $(this.triggeringElement).attr("data-deptno3")
Affected Elements :
Selection Type : Items
Items : P9_DEPT_ID_FOR_EMP_LIST
Again True Action : Refresh
Selection Type : Region
Region : Department Wise Employee List
Step-6:
=====
Select Region Department Wise Employee List.
Create Button For Hide this Region. (Button Name : Hide)
Dynamic Action : Hide_emp_list_region
Action : Set Value
Set Type : Static Assignment
Value : 0
Affected Elements: P9_DEPT_ID_FOR_EMP_LIST