Exporting to a comma-separated file
APEX offers a standard built-in to export data to a Comma-separated Value (CSV) file. A CSV file is readable by Microsoft Excel or OpenOffice Calc. Each row contains the data of a record in a table and each value in the row is separated by a comma and represents the value of a column of the table. When Export to CSV is enabled, a link is shown just below the region with the data. We will show you how to add this link.
Getting ready
You should have a working application with at least one standard report. If you don't have a report, create one. You can find a recipe for creating a simple report in Chapter 1, Creating a Basic APEX Application.
How to do it...
First, we will adapt the report and then we will put a link on the report.
Go to the Report page.
In the Regions section, click on the Report link.
In the Report Export section, select Yes in the Enable CSV output listbox:
In the Link Label text field, enter
Export to csv
. This text appears as a link below...