Searching pivotTable using dvt:pivotFilterBar in Oracle ADF

Sharing is Caring

dvt:pivotTable-

From Oracle docs- The Pivot Table supports the display of multiple nested attributes on a row and column header. In addition, the Pivot Table supports the ability to dynamically change the layout of the attributes displayed in the row or column headers via drag and drop pivoting.

Framework provides  <dvt:pivotFilterBar>component to perform search operation on pivotTable
The PivotFilterBar component is used to filter data based on the selected criterion belonging to the PivotableQueryDescriptor as specified by the value property

In this example, I am using the Departments and Employees table of HR Schema, Created a query based viewObject using this query (to show Departments and it’s Employees)

SELECT A.DEPARTMENT_ID,  
B.EMPLOYEE_ID, 
A.DEPARTMENT_NAME , 
B.FIRST_NAME||' '||B.LAST_NAME AS NAME,  
B.EMAIL,  
B.PHONE_NUMBER, 
B.HIRE_DATE, 
B.JOB_ID, 
B.SALARY, 
B.COMMISSION_PCT 
FROM DEPARTMENTS A, EMPLOYEES B 
WHERE A.DEPARTMENT_ID=B.DEPARTMENT_ID

Add this viewObject to Application Module and drop on the page as pivot table from Data Control

Configuration for pivotTable-

Pivot Table data set

 

 

Pivot Table Drilling

Finally, it looks like this-

pivotTable

Now I have dropped <dvt:pivotTable> on the page and it automatically sets its properties that are required for filtering pivotTable

<dvt:pivotFilterBar id="pt1pivotFilterBar" value="#{bindings.DeptEmp1.pivotFilterBarModel}"
                                    modelName="pt1Model"/>

Once check that modelName property should be the same for both PivotTable and filter bar
Now run this application and drop any column on filterbar that you want to search

Pivot Filter bar (Oracle ADF)

Sample ADF Application-Download
Cheers 🙂 Happy Learning

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *