Download the PHP package yidas/phpspreadsheet-helper without Composer

On this page you can find all versions of the php package yidas/phpspreadsheet-helper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

Please rate this library. Is it a good library?

All versions of phpspreadsheet-helper with dependencies

Informations about the package phpspreadsheet-helper

PHPSpreadsheet Helper

PHP Excel Helper - Write and read Spreadsheet with easy way based on PhpSpreadsheet

Latest Stable Version License Total Downloads Monthly Downloads

This library is a helper that encapsulate PhpSpreadsheet (Documentation) for simple usage.


OUTLINE


DEMONSTRATION

Write to Excel

Output an Excel file to browser for download:

Read from Excel

Import above excel file and return two-dimensional array data contained rows > columns spread sheet:

Output result:


REQUIREMENTS

This library requires the following:


INSTALLATION

Run Composer in your project:

composer require yidas/phpspreadsheet-helper

Then you could call it after Composer is loaded depended on your PHP framework:


USAGE

Import & Export

Simpliy read an Excel file then output to browser:

newSpreadsheet()

New or load an PhpSpreadsheet object

output()

Output file to browser

$format list: Xlsx, Xls, Html, Csv, Ods

save()

Save as file

Example:

Get Rows

getRow()

Get data of a row from the actived sheet of PhpSpreadsheet

Example:

Example of fetching content per each row (Example Code):

getRows()

Get rows from the actived sheet of PhpSpreadsheet

Example of getRows()

Add Rows

addRow()

Add a row to the actived sheet of PhpSpreadsheet

$rowData value: An array contains string or array of attributes for each cell
$rowAttributes value: string or array of attributes for each cell of a row

Example of addRow()

Example of setting attributes for each cell:

Example of setting attributes for each row:

addRows()

Add rows to the actived sheet of PhpSpreadsheet

$data value: array of each $rowData from addRow()
$rowAttributes value: string or array of attributes for each row

Example of addRows()

Attributes

Attributes is a standard array for defining a cell or even a row, the keys are as follows:

key, value, style

PhpSpreadsheet Original Usage Integration

This helper is flexible that you could inject or extract original PhpSpreadsheet with it, when you need to manipulate some Phpspreadsheet methods integrated with Helper.

Inject PhpSpreadsheet

Extract PhpSpreadsheet

Merge Cells

It's easy to merge cells by defining each cell's span attributes:

Multiple Sheets

setSheet()

Set an active PhpSpreadsheet Sheet

getSheet()

Get PhpSpreadsheet Sheet object from cache

Example:

Map of Coordinates & Ranges

The result could be:

Style Attributes

The style attribute could be set on a range of cells.

Style array key/value/constant refers Valid array keys for style applyFromArray() or Source Classes

Columns Format

The options for each cell data:

All Cells Format

This section focuses on applying all actived cells or ranged cells on the sheet, not just effecting single cell, row or column.

setStyle()

Set Style for all actived cells or set by giving range to the actived sheet

Example:

setWrapText()

Set WrapText for all actived cells or set by giving range to the actived sheet

setAutoSize()

Set AutoSize for all actived cells or set by giving column range to the actived sheet


LIMITATIONS

Performance Issue

If you're building large cell data with XLSX, you may face performance issue with memory usage and execution time.

box/spout spreadsheet lirary supports building Excel file with high performance, you could use this library instead if you do not need more style and formatting requirements.


Version
Requires phpoffice/phpspreadsheet Version ^1.1.0

The package yidas/phpspreadsheet-helper contains the following files

Loading the files please wait ....