Exporting data to a client file

You can export data from the server and download it to a file in the client by using the ADF Faces File Download Action Listener component, available in the Operations section of the Component Palette. Simply specify the default export filename and a managed bean method to handle the download. To actually export the data from the model using business components, you will have to iterate through the relevant view object and generate the exported string buffer.

In this recipe, we will use the File Download Action Listener component (af:fileDownloadActionListener) to demonstrate how to export all employees to a client file. The employees will be saved in the file in a comma-separated-values (CSV) format.

Getting ready ...

Get Oracle JDeveloper 11gR2 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.