PHPackages                             yectep/phpspreadsheet-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. yectep/phpspreadsheet-bundle

ActiveSymfony-bundle[PDF &amp; Document Generation](/categories/documents)

yectep/phpspreadsheet-bundle
============================

A Symfony bundle to integrate with PHPOffice's PhpSpreadsheet library

v1.1.0(2y ago)592.4M↓54.6%26[7 issues](https://github.com/eightyknots/phpspreadsheet-bundle/issues)[1 PRs](https://github.com/eightyknots/phpspreadsheet-bundle/pulls)4MITPHPPHP &gt;=7.2

Since Feb 14Pushed 2y ago4 watchersCompare

[ Source](https://github.com/eightyknots/phpspreadsheet-bundle)[ Packagist](https://packagist.org/packages/yectep/phpspreadsheet-bundle)[ RSS](/packages/yectep-phpspreadsheet-bundle/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (8)Dependencies (2)Versions (13)Used By (4)

PhpSpreadsheetBundle
====================

[](#phpspreadsheetbundle)

This bundle integrates your Symfony 4/5/6/7 app with the PHPOffice PhpSpreadsheet productivity library.

Requirements
------------

[](#requirements)

This bundle requires, in addition to prerequisites of each PHPOffice library:

```
* PHP 7.2 or higher
* Symfony 4 or higher

```

Note: Tags older than v1.0.0 (e.g. v0.2.0) are no longer supported due to deprecated status for both PHP &lt;= 7.1 and Symfony &lt;= 4.4.

Installation
------------

[](#installation)

Use composer to require the latest stable version.

```
composer require yectep/phpspreadsheet-bundle
```

If you're not using Flex, enable the bundle in your `AppKernel.php` or `bundles.php` file.

```
$bundles = array(
    [...]
    new Yectep\PhpSpreadsheetBundle\PhpSpreadsheetBundle(),
);
```

Usage
-----

[](#usage)

This bundle enables the `phpoffice.spreadsheet` service.

See also the official [PHPOffice PhpSpreadsheet documentation](http://phpspreadsheet.readthedocs.io/).

### createSpreadsheet()

[](#createspreadsheet)

Creates an empty `\PhpOffice\PhpSpreadsheet\Spreadsheet` object, or, if an optional `$filename` is passed, instantiates the `\PhpOffice\PhpSpreadsheet\IOFactory` to automatically detect and use the appropriate `IWriter` class to read the file.

```
// In your controller
$newSpreadsheet = $this->get('phpoffice.spreadsheet')->createSpreadsheet();
$existingXlsx   = $this->get('phpoffice.spreadsheet')->createSpreadsheet('/path/to/file.xlsx');
```

### createReader(`string` $type)

[](#createreaderstring-type)

Returns an instance of the `\PhpOffice\PhpSpreadsheet\Reader` class of the given `$type`.

Types are case sensitive. Supported types are:

- `Xlsx`: Excel 2007
- `Xls`: Excel 5/BIFF (95)
- `Xml`: Excel 2003 XML
- `Slk`: Symbolic Link (SYLK)
- `Ods`: Open/Libre Office (ODS)
- `Csv`: CSV
- `Html`: HTML

```
$readerXlsx  = $this->get('phpoffice.spreadsheet')->createReader('Xlsx');
$spreadsheet = $readerXlsx->load('/path/to/file.xlsx');
```

### createWriter(`Spreadsheet` $spreadsheet, `string` $type)

[](#createwriterspreadsheet-spreadsheet-string-type)

Given a `\PhpOffice\PhpSpreadsheet\Spreadsheet` object and a writer `$type`, returns an instance of a `\PhpOffice\PhpSpreadsheet\Writer` class for that type.

In addition the the read types above, these types are additionally supported for writing, if the appropriate PHP libraries are installed.

- `Tcpdf`
- `Mpdf`
- `Dompdf`

```
$spreadsheet = $this->get('phpoffice.spreadsheet')->createSpreadsheet();
$spreadsheet->getActiveSheet()->setCellValue('A1', 'Hello world');

$writerXlsx = $this->get('phpoffice.spreadsheet')->createWriter($spreadsheet, 'Xlsx');
$writerXlsx->save('/path/to/destination.xlsx');
```

Roadmap and Contributions
-------------------------

[](#roadmap-and-contributions)

Contributions are more than welcome. Fork the project, and submit a PR when you're done.

Remaining todos include:

- Tests and test coverage
- TravisCI
- Improved documentation

Symfony serializer
------------------

[](#symfony-serializer)

If you are migrating from Symfony Serializer component + CSV encoder - you can use code like

```
$spreadsheet = $this->get('phpoffice.spreadsheet')->createSpreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$sheet->setTitle($this->filterVars['wareCategory']->getTitle());
$columnsMap = [];
$lineIndex = 2;
foreach ($data as $line) {
   foreach ($line as $columnName=>$columnValue) {
       if (is_int($columnIndex = array_search($columnName, $columnsMap))) {
           $columnIndex++;
       } else {
           $columnsMap[] = $columnName;
           $columnIndex = count($columnsMap);
       }
       $sheet->getCellByColumnAndRow($columnIndex, $lineIndex)->setValue($columnValue);
   }
   $lineIndex++;
}
foreach ($columnsMap as $columnMapId=>$columnTitle) {
   $sheet->getCellByColumnAndRow($columnMapId+1, 1)->setValue($columnTitle);
}
$writer = $this->get('phpoffice.spreadsheet')->createWriter($spreadsheet, 'Xlsx');
ob_start();
$writer->save('php://output');
$excelOutput = ob_get_clean();

return new Response(
   $excelOutput,
   200,
   [
       'content-type'        =>  'text/x-csv; charset=windows-1251',
       'Content-Disposition' => 'attachment; filename="price.xlsx"'
   ]
);
```

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity55

Moderate usage in the ecosystem

Community29

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~211 days

Recently: every ~353 days

Total

11

Last Release

942d ago

Major Versions

v0.2.0 → v1.0.02022-01-20

PHP version history (2 changes)v0.0.1PHP &gt;=5.6

v1.0.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/f2b2678b1f6a6a3379f5d5edc3a46a62c0a02c03b8cc2890179c2740977b3382?d=identicon)[yectep](/maintainers/yectep)

---

Top Contributors

[![eightyknots](https://avatars.githubusercontent.com/u/660703?v=4)](https://github.com/eightyknots "eightyknots (10 commits)")[![andrea-daru](https://avatars.githubusercontent.com/u/8058905?v=4)](https://github.com/andrea-daru "andrea-daru (5 commits)")[![tacman](https://avatars.githubusercontent.com/u/619585?v=4)](https://github.com/tacman "tacman (3 commits)")[![zhil](https://avatars.githubusercontent.com/u/981783?v=4)](https://github.com/zhil "zhil (2 commits)")[![Dodenis](https://avatars.githubusercontent.com/u/39649301?v=4)](https://github.com/Dodenis "Dodenis (2 commits)")[![OskarStark](https://avatars.githubusercontent.com/u/995707?v=4)](https://github.com/OskarStark "OskarStark (2 commits)")[![LJaschinski](https://avatars.githubusercontent.com/u/11751408?v=4)](https://github.com/LJaschinski "LJaschinski (1 commits)")[![Chris53897](https://avatars.githubusercontent.com/u/7104259?v=4)](https://github.com/Chris53897 "Chris53897 (1 commits)")[![pekkast](https://avatars.githubusercontent.com/u/1282829?v=4)](https://github.com/pekkast "pekkast (1 commits)")[![qdequippe](https://avatars.githubusercontent.com/u/3193300?v=4)](https://github.com/qdequippe "qdequippe (1 commits)")[![g-g](https://avatars.githubusercontent.com/u/765134?v=4)](https://github.com/g-g "g-g (1 commits)")[![goodjinny](https://avatars.githubusercontent.com/u/13361839?v=4)](https://github.com/goodjinny "goodjinny (1 commits)")

---

Tags

excelofficephp-librarysymfonysymfony-bundle

### Embed Badge

![Health badge](/badges/yectep-phpspreadsheet-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/yectep-phpspreadsheet-bundle/health.svg)](https://phpackages.com/packages/yectep-phpspreadsheet-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.1k17.8k](/packages/prestashop-prestashop)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
