All Projects → pear → Spreadsheet_Excel_Writer

pear / Spreadsheet_Excel_Writer

Licence: other
Allows writing of Excel spreadsheets. Since 2002.

Programming Languages

PHP
23972 projects - #3 most used programming language

Labels

Projects that are alternatives of or similar to Spreadsheet Excel Writer

Office365FiddlerExtension
This Fiddler Extension is an Office 365 centric parser to efficiently troubleshoot Office 365 client application connectivity and functionality.
Stars: ✭ 23 (-45.24%)
Mutual labels:  excel
Sylvan.Data.Excel
The fastest .NET library for reading Excel data files.
Stars: ✭ 65 (+54.76%)
Mutual labels:  excel
luban
你的最佳游戏配置解决方案 {excel, csv, xls, xlsx, json, bson, xml, yaml, lua, unity scriptableobject} => {json, bson, xml, lua, yaml, protobuf(pb), msgpack, flatbuffers, erlang, custom template} data + {c++, java, c#, go(golang), lua, javascript(js), typescript(ts), erlang, rust, gdscript, protobuf schema, flatbuffers schema, custom template} code。
Stars: ✭ 1,660 (+3852.38%)
Mutual labels:  excel
qsv
CSVs sliced, diced & analyzed.
Stars: ✭ 438 (+942.86%)
Mutual labels:  excel
Excel-to-JSON
Excel add-in converting excel to json
Stars: ✭ 15 (-64.29%)
Mutual labels:  excel
Excelerator
This is an Excel Addin for Windows that reads and writes data to Snowflake
Stars: ✭ 53 (+26.19%)
Mutual labels:  excel
spreadcheetah
SpreadCheetah is a high-performance .NET library for generating spreadsheet (Microsoft Excel XLSX) files.
Stars: ✭ 107 (+154.76%)
Mutual labels:  excel
Power-Query-Excel-Formats
A collection of M code to get various formats from Excel sheets in Power Query
Stars: ✭ 43 (+2.38%)
Mutual labels:  excel
sense-export
Just a simple button to export data in your Qlik Sense applications.
Stars: ✭ 28 (-33.33%)
Mutual labels:  excel
office-addin-react
To help you learn to use Office.js and React build an Excel add-in
Stars: ✭ 46 (+9.52%)
Mutual labels:  excel
ByteScout-SDK-SourceCode
ALL source code samples for ByteScout SDKs and Web API API products.
Stars: ✭ 24 (-42.86%)
Mutual labels:  excel
json2xls
{"generate excel by json data": "根据json数据生成Excel表格"}
Stars: ✭ 30 (-28.57%)
Mutual labels:  excel
web-pivot-table
A feature-rich JS pivot grid library for creating interactive reports. Integrates with any front-end technology
Stars: ✭ 35 (-16.67%)
Mutual labels:  excel
datapackage-m
Power Query M functions for working with Tabular Data Packages (Frictionless Data) in Power BI and Excel
Stars: ✭ 26 (-38.1%)
Mutual labels:  excel
xlsxd
A thin wrapper around libxlsx to write excel spreadsheets
Stars: ✭ 16 (-61.9%)
Mutual labels:  excel
database-js
Common Database Interface for Node
Stars: ✭ 58 (+38.1%)
Mutual labels:  excel
laravel-xlswriter
an excel export/import tool for laravel based on php-xlswriter
Stars: ✭ 54 (+28.57%)
Mutual labels:  excel
ExcelUtil
Excel utility for Java to read and write data in declarative way.
Stars: ✭ 27 (-35.71%)
Mutual labels:  excel
xls2db
Export table data from excel to mysql database, implemented with python.
Stars: ✭ 33 (-21.43%)
Mutual labels:  excel
spreadsheet
TypeScript/javascript spreadsheet parser, with formulas.
Stars: ✭ 40 (-4.76%)
Mutual labels:  excel

Build Status Latest Stable Version Coverage Status

Spreadsheet_Excel_Writer

This package is Spreadsheet_Excel_Writer and has been migrated from svn.php.net.

Please report all new issues via the PEAR bug tracker.

If this package is marked as unmaintained and you have fixes, please submit your pull requests and start discussion on the pear-qa mailing list.

Installation

Pear

To test, run

$ phpunit

To build, simply

$ pear package

To install from scratch

$ pear install package.xml

To upgrade

$ pear upgrade -f package.xml

Composer

This package comes with support for Composer.

To install from Composer

$ composer require pear/spreadsheet_excel_writer

To install the latest development version

$ composer require pear/spreadsheet_excel_writer:dev-master

Features

  • writing Excel (.XLS) spreadsheets
  • support: strings (with formatting for text and cells), formulas, images (BMP)

Limitations

Library support only 2 types of format for writing XLS, also known as Binary Interchange File Format (BIFF):

  • BIFF5 (Excel 5.0 - Excel 95)
  • BIFF8 (Excel 98 - Excel 2003)

Some important limitations:

Limit BIFF5 BIFF8
Maximum number of rows 16384 65535
Maximum number of columns 255 255
Maximum data size of a record 2080 bytes 8224 bytes
Unicode support CodePage based character encoding UTF-16LE

Explanation of formats and specifications you can find here (section "Useful references")

Correct output only guaranteed with mbstring.func_overload = 0 otherwise, you should use workround mb_internal_encoding('latin1');

Usage

Basic usage

use Spreadsheet_Excel_Writer;


$filePath = __DIR__ . '/output/out.xls';
$xls = new Spreadsheet_Excel_Writer($filePath);

// 8 = BIFF8
$xls->setVersion(8);

$sheet = $xls->addWorksheet('info');

// only available with BIFF8
$sheet->setInputEncoding('UTF-8');

$headers = [
    'id',
    'name',
    'email',
    'code',
    'address'
];

$row = $col = 0;
foreach ($headers as $header) {
    $sheet->write($row, $col, $header);
    $col++;
}

for ($id = 1; $id < 100; $id++) {
    $data = [
        'id' => $id,
        'name' => 'Name Surname',
        'email' => '[email protected]',
        'password' => 'cfcd208495d565ef66e7dff9f98764da',
        'address' => '00000 North Tantau Avenue. Cupertino, CA 12345. (000) 1234567'
    ];
    $sheet->writeRow($id, 0, $data);
}

$xls->close();

Format usage

$xls = new Spreadsheet_Excel_Writer();

$titleFormat = $xls->addFormat(); 
$titleFormat->setFontFamily('Helvetica');
$titleFormat->setBold();
$titleFormat->setSize(10);
$titleFormat->setColor('orange'); 
$titleFormat->setBorder(1);
$titleFormat->setBottom(2);
$titleFormat->setBottomColor(44);
$titleFormat->setAlign('center');

$sheet = $xls->addWorksheet('info'); 

$sheet->write(0, 0, 'Text 123', $titleFormat);

Header usage (Sending HTTP header for download dialog)

$xls = new Spreadsheet_Excel_Writer();
$xls->send('excel_'.date("Y-m-d__H:i:s").'.xls');

Performance

Platform:
Intel(R) Core(TM) i5-4670 CPU @ 3.40GHz
PHP 7.4

Test case:
Write xls (BIFF8 format, UTF-8), by 5 cells (1x number, 4x string without format/styles, average line length = 120 char) in each row

Estimated performance:

Number of rows Time (seconds) Peak memory usage (MB)
10000 0.2 4
20000 0.4 4
30000 0.6 6
40000 0.8 6
50000 1.0 8
65534 1.2 8

Alternative solutions

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].