Excel LibXL

Component ID

2902388

Component name

Excel LibXL

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Downloads

228

Component created

Component changed

Component body

This module provides an Excel encoder via LibXL Library (commerce) for the Drupal 8 Serialization API. This enables the XLS and XLSX format to be used for data output.

PHP extension uses libXl library to provide API for generating or parsing all Excel files.
LibXL is a high-performance mechanism for working with Excel files and is able to generate output readable on Blackberries, iPhone, Office Products, Numbers, etc...
Additional information: LibXL, PHP Extension (iliaal/php_excel)

LibXL + php_excel - is the fastest option with perfect perfomance and low memory usage for PHP import/export functionality to Excel.

Small comparison:

*** PHPExcel:

Without caching:
Rows | Time | Memory usage | Memory per cell
10k | 70s | 370 Mb | 2.4 Kb
50k | 10m | 1790 Mb | 2.4 Kb

Caching (cache_in_memory_gzip):
Rows | Time | Memory usage | Memory per cell
10k | 110s | 181 Mb | 1.2 Kb
50k | 10m | 865 Mb | 1.1 Kb
100k | 20m | 1718 Mb | 1.1 Kb

Caching (cache_to_disc):
Rows | Time | Memory usage | Memory per cell
10k | 90 | 218 Mb | 1.4 Kb

*** LibXL:
Rows | Time | Memory usage |
100k | 25s | 1100 Mb |
200k | 50s | 2200 Mb |
300k | 85s | 3500 Mb |

For example:
Drupal 8's REST module can return data in XLS/XLSX format.
Views can output XLS/XLSX data via a 'REST Export' view.

Module developers can leverage XLS/XLSX as a format when using the Serialization API.
Installation:

  • Compile and install PHP Extension.
  • Enable the excel_libxl module.

Creating an XLS/XLSX export via Views.

  1. Create a new view
  2. Add a REST Export view.
  3. Check only 'xls' or 'xlsx' for the accepted request formats under Format > Data export > Settings.
  4. Add desired fields to the view.
  5. Change labels for fields in the view (used as Table Header).
  6. Add a path.