Important

You are browsing the documentation for version 4.1 of OroCommerce, OroCRM and OroPlatform, which is no longer maintained. Read version 5.1 (the latest LTS version) of the Oro documentation to get up-to-date information.

See our Release Process documentation for more information on the currently supported and upcoming releases.

Export Extension

This extension provides a functionality to export grid rows. This allows you to export rows from all pages. The exported data will be the same as on a grid, including filters and sorting.

Configuration

To enable export functionality you just need to add export option to a configuration of your grid. For example:

1 datagrids:
2     accounts-grid:
3         ...
4         options:
5             export: true

After that Export button will be displayed in the top left corner of a grid. To export grid data, users need to click this button and select the format of exporting data (currently only CSV format is implemented).

If you need to allow to export grid data in other formats, you need to configure your grid properly. For example, to allow export data in CSV and PDF formats you can use the following configuration:

1 datagrids:
2     my-grid:
3         ...
4         options:
5             export:
6                 csv: { label: oro.grid.export.csv }
7                 pdf: { label: acme.grid.export.pdf }

You also need to implement and register a writer for the new export format. To register a writer in dependency container, use the following naming convention: oro_importexport.writer.echo.[format]. So, a writer for PDF should be registerd as oro_importexport.writer.echo.pdf.

You can use existing CSV writer as an example for your writer.

There is also the ability to influence performance by changing the value of the grid export page size in the configuration. This will allow you to change the number of queries to the database. But keep in mind that increasing the size of the batch increases memory consumption.

1 datagrids:
2     my-grid:
3         ...
4         options:
5             export:
6                 csv:
7                     label: oro.grid.export.csv
8                     page_size: 500