Download the PHP package avadim/fast-excel-writer without Composer
On this page you can find all versions of the php package avadim/fast-excel-writer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download avadim/fast-excel-writer
More information about avadim/fast-excel-writer
Files in avadim/fast-excel-writer
Package fast-excel-writer
Short Description Lightweight and very fast XLSX Excel Spreadsheet Writer in PHP
License MIT
Homepage https://github.com/aVadim483/fast-excel-writer
Informations about the package fast-excel-writer
FastExcelWriter |
FastExcelWriter is a part of the FastExcelPhp Project which consists of
- FastExcelWriter - to create Excel spreadsheets
- FastExcelReader - to read Excel spreadsheets
- FastExcelTemplator - to generate Excel spreadsheets from XLSX templates
- FastExcelLaravel - special Laravel edition
Introduction
This library is designed to be lightweight, super-fast and requires minimal memory usage.
FastExcelWriter creates Excel compatible spreadsheets in XLSX format (Office 2007+), with many features supported:
- Takes UTF-8 encoded input
- Multiple worksheets
- Supports currency/date/numeric cell formatting, formulas and active hyperlinks
- Supports most styling options for cells, rows, columns - colors, borders, fonts, etc.
- You can set the height of the rows and the width of the columns (including auto width calculation)
- You can add formulas, notes and images in you XLSX-files
- Supports workbook and sheet protection with/without passwords
- Supports page settings - page margins, page size
- Inserting multiple charts
Jump To:
- Changes in version 4
- Changes in version 5
- Simple Example
- Advanced Example
- Row's settings
- Column's settings
- Define Named Ranges
- Adding Notes
- Adding Images
- Workbook
- Workbook settings
- Sets metadata of workbook
- Set Directory For Temporary Files
- Helpers methods
- Sheets
- Create, select and remove sheet
- Sheet settings
- Page settings
- Freeze Panes and Autofilter
- Setting Active Cells
- Writing
- Writing Row by Row vs Direct
- Direct Writing To Cells
- Writing Cell Values
- Merging Cells
- Cell Formats
- Formulas
- Hyperlinks
- Styles
- Cell Styles
- Row Styles
- Column Styles
- Other Columns Options
- Apply Styles (The Fluent Interface)
- Apply Borders
- Apply Fonts
- Apply Colors
- Apply Text Styles
- Charts
- Simple usage
- Combo charts
- Multiple charts
- Chart types
- Useful Chart Methods
- Protection of workbook and sheets
- Workbook protection
- Sheet protection
- Cells locking/unlocking
- FastExcelWriter vs PhpSpreadsheet
- Do you want to support FastExcelWriter?
Installation
Use composer
to install FastExcelWriter into your project:
Changes In Version 4
- Now the library works even faster
- Added a fluent interface for applying styles.
- New methods and code refactoring
Changes In Version 5
- General is Chart support
Usage
You can find usage examples below or in /demo folder
Simple Example
Also, you can download generated file to client (send to browser)
Advanced Example
Row's settings
You can set row options (styles and height) by the second argument when you use the function . Note that in this case these styles will only be applied to those cells in the row where data is written
Other way with the same result
You can set row's height or visibility
IMPORTANT: You can only use the setRowXX() functions on rows numbered at least as high as the current one. See Writing Row by Row vs Direct Therefore, the following code will throw an error "Row number must be greater then written rows"
Column's settings
Column widths can be set in several ways
You can define a minimal width of columns. Note that the minimum value has higher priority
Define Named Ranges
FastExcelWriter supports named ranges and does not support named formulae. A named ranges provides a name reference to a cell or a range of cells. All named ranges are added to the workbook so all names must be unique, but you can define named ranges in a sheet or in a workbook.
Also range names must start with a letter or underscore, have no spaces, and be no longer than 255 characters.
Adding Notes
There are currently two types of comments in Excel - comments and notes (see The difference between threaded comments and notes). Notes are old style comments in Excel (text on a light yellow background). You can add notes to any cells using method
You can change some note options. Allowed options of a note are:
- width - default value is
- height - default value is
- fill_color - default value is
- show - default value is
Adding Images
FastExcelWriter vs PhpSpreadsheet
PhpSpreadsheet is a perfect library with wonderful features for reading and writing many document formats. FastExcelWriter can only write and only in XLSX format, but does it very fast and with minimal memory usage.
FastExcelWriter:
- 7-9 times faster
- uses less memory by 8-10 times
- supports writing huge 100K+ row spreadsheets
Benchmark of PhpSpreadsheet (P) and FastExcelWriter (F), spreadsheet generation without styles
Rows x Cols | Time P | Time F | Memory P | Memory F |
---|---|---|---|---|
1000 x 5 | 0.98 sec | 0.19 sec | 2,048 Kb | 2,048 Kb |
1000 x 25 | 4.68 sec | 1.36 sec | 14,336 Kb | 2,048 Kb |
5000 x 25 | 23.19 sec | 3.61 sec | 77,824 Kb | 2,048 Kb |
10000 x 50 | 105.8 sec | 13.02 sec | 256,000 Kb | 2,048 Kb |
Do you want to support FastExcelWriter?
if you find this package useful you can support and donate to me for a cup of coffee:
- USDT (TRC20) TSsUFvJehQBJCKeYgNNR1cpswY6JZnbZK7
- USDT (ERC20) 0x5244519D65035aF868a010C2f68a086F473FC82b
- ETH 0x5244519D65035aF868a010C2f68a086F473FC82b
Or just give me a star on GitHub :)
All versions of fast-excel-writer with dependencies
ext-zip Version *
ext-json Version *
ext-mbstring Version *
ext-intl Version *
avadim/fast-excel-helper Version ^1.0