By disdiv | April 27, 2011 | 10 Comment
In many report based or any other data related application export to excel feature is always required.
Export to excel feature can be achieved in ADF very easily, may be just in 10 minutes we can see the result excel sheet. To achieve this in this project I have first created ADF business components from HR.Employee table. Then I created one jspx page to display the employee details table. Now I want to export this tabular data in one excel named Employee.xls. want that the employee details data will be displayed under title “List Of Employees ” title.
Now as export to excel will be available on some action so I added one command button here named “Export Collection”
I have inserted one exportCollectionActionListener inside the command button. This takes 5 parameters, 2 of them are mandatory.
Mandatory fields are:
ExportedId: The table or collection id you want to export
Type: The export type. As it is excel here it should be excelHTML
I have provided values for other two optional fields :
filename: I wanted that the file name should be Employee.xls
title: I wanted the title to be here “List of Employees”
Now if I run the page and click the command button “Export Collection” it will export the table data in one Excel Sheet named “Employee.xls”
The title of the sheet should be “List of Employees ” as shown below.
Please comment …….
If source code is required please email me.