Download the PHP package fastbolt/excel-writer without Composer
On this page you can find all versions of the php package fastbolt/excel-writer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
More information about fastbolt/excel-writer
Files in fastbolt/excel-writer
Informations about the package excel-writer
This component is used for simple Excel-file generation in Symfony. You can pass either arrays of arrays, or arrays of entities to the generator class. If an entity references another entity as it's attribute, you will need to pass a callable to retrieve a specific value from that entity.
This package is available through Composer/Packagist:
The width of the table is set by the number of headers. The number of rows is set by the amount of data.
The order of columns is determined by the order of ColumnSetting instances given to ExcelGenerator::setColumns(). You need to define at least one column. The order of the content will not be changed if an array is passed to setContent().
If you are passing objects to setContent(), you will need to provide the name of the method that returns the values you want to display (like "getName").
You can also pass closures instead of the getter.
Create an instance of the TableStyle class and set styles for the header row and the content. Pass the TableStyle to the generator.
To apply styles to individual columns, you can either pass the style arrays as the 5th (header style) and 6th (data style) argument to the constructor, or use the setter of the ColumnSettings class.
Autofilters can be set by calling the generator's setter method and passing a range:
The following styles are presets, but can be overwritten in the TableStyle class
- borders: medium
- vertical-alignment: center
- horizontal-alignment: center
- color: FF366092 (blue)
You can merge cells by passing an array of coordinate ranges to the generator 'mergeCells'-method. The content of the resulting cell will be centered. Calling the method multiple times will not overwrite previous merges.
- Floats have a preset decimal length of 2 (0.12), but that can be configured with the 4th parameter of the ColumnSetting constructor or its method setDecimalLength().
- PHP and Excel have problems working with large numbers. Pass numbers with 16+ digits as strings to string columns to display them correctly.