Creating and Exporting hierarchical data to excel using dvt:pivotTable & dvt:exportPivotTableData in Oracle ADF

Sharing is Caring

Hello All,
This post is about exporting tree-structured (hierarchical ) data to an excel file.
suppose we have export department wise detail of employees, we can achieve this in ADF using pivot table (dvt:pivotTable)

What is pivot table (Oracle docs)- 
UIComponent class:
Component type: oracle.dss.adf.pivotTable.PivotTable
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.
now see the implementation part –

    • Create a Fusion Web Application using HRSchema, for this sample app I have created a view (Department Wise Employees) to export data



    • Prepare model using this view



    • Create a page and drop this view as pivot table (ADF Faces component) from the data control



    • Now configure pivot table (set row & column attributes, insert appropriate drilling) – see the snaps





    • Now run your page and see working pivot table – here pivot table is created successfully



    • Drop a button  and a <dvt:exportPivotTableData> under button to export pivot table

<af:commandButton text="Export" id="b1">
                    <dvt:exportPivotTableData type="excelHTML" exportedId="pt1" filename="Dep_Empl.xls"
                                              title="PivotTable export"/>


  • Run your page and click on the export button and see your tree-structured data in exported excel file



Sample ADF Application- Download

Cheers 🙂 Happy Learning

Related Posts

0 thoughts on “Creating and Exporting hierarchical data to excel using dvt:pivotTable & dvt:exportPivotTableData in Oracle ADF”

  1. Is it possible adf pivot table using master details relationship?
    Let say in my master department table dept id 100 and in employee details table 5 employee belongs to dept id 100.same way for dept id 101 ,5 employee are there etc.My requirement is,my pivot table will dynamically show in UI separately for 10 employee one pivot table and for 5 employee another pivot table like this.

  2. Hi
    I have a problem with pivot table scrollbar when page is right to left in Arabic locale
    have you any idea about this problem ?
    when pivot table becomes too larg and needs to scroll horizentally,the scrollbar dose not work fine,
    please check it,there is no answer for this problem.

  3. The scrollbar is appearing.let's talk about a have a pivot table with 10 columns,1 to 10,columns number 1 to 5 are visible and number 6 to 10 are out and you need to scroll left to see them.when you scroll left columns should go right but they go left too.this problem happens only when the page is right to left.

Leave a Reply

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