JDev11g Export Table To Excel

Posted by Steve Racanovic | Posted in | Posted on 9:11 AM


JDev 11g offers a simple way to export an ADF table to excel in a couple simple steps.

1. Create af:panelCollection on the jspx page.
2. Drag a data control onto af:panelCollection and drop it as table.
3. Set af:table id to table.
4. Expand Panel Collection facets, and drop af:toolbar on toolbar facet.
5. Drop af:commandButton on af:toolbar. Set the text to "Export To Excel"
6. Drop af:exportCollectionActionListener on af:commandButton. And set the following:

ExportId: table
Type: excelHTML
Filename: Emp.xls
Title: Employees.

The exportId needs to bind to the af:table id. Which we set as 'table' in step 3

7. Run the jspx page and test the export button.

This is how the my final code looks like:

<facet name="menus"/>
<facet name="toolbar">
<commandButton text="Export To Excel">
<exportCollectionActionListener exportedId="table" type="excelHTML"
filename="Emp.xls" title="Employees"/>
<facet name="statusbar"/>
<table value="#{bindings.EmpView1.collectionModel}" var="row"
emptyText="#{bindings.EmpView1.viewable ? 'No rows yet.' : 'Access Denied.'}"
fetchSize="#{bindings.EmpView1.rangeSize}" filterVisible="false"
<column sortProperty="Empno" sortable="false"
<outputText value="#{row.Empno}">
<convertNumber groupingUsed="false"

Comments (0)