PHPackages                             fungio/excel-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. fungio/excel-bundle

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

fungio/excel-bundle
===================

This is a Symfony2 Bundle helps you to read and write Excel files (including pdf, xlsx, odt), thanks to the PHPExcel library

v2.1.0(10y ago)15.3k11MITPHPPHP &gt;=5.3.2

Since Sep 28Pushed 3y agoCompare

[ Source](https://github.com/fungio/FungioExcelBundle)[ Packagist](https://packagist.org/packages/fungio/excel-bundle)[ Docs](http://www.welcometothebundle.com)[ RSS](/packages/fungio-excel-bundle/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (9)Versions (16)Used By (1)

Symfony2 Excel bundle
=====================

[](#symfony2-excel-bundle)

This bundle permits you to create, modify and read excel objects.

[![Build Status](https://camo.githubusercontent.com/a4dbd9ac803ebf72e9a4889fb895c660e3bd30232a99fa36bfb10f3e63b513b9/68747470733a2f2f7472617669732d63692e6f72672f66756e67696f2f457863656c42756e646c652e706e67)](https://travis-ci.org/fungio/ExcelBundle)[![Total Downloads](https://camo.githubusercontent.com/56e5bb6ab29f28bea4c27ea9f5c3e29d7bdc92987b21535edf17bcbec4df27ac/68747470733a2f2f706f7365722e707567782e6f72672f66756e67696f2f457863656c42756e646c652f646f776e6c6f6164732e706e67)](https://packagist.org/packages/fungio/ExcelBundle)[![Latest Stable Version](https://camo.githubusercontent.com/01cf95986289aad5e54ecf93bc78dab5591bc91c0a1ffb09906e4a34b53ca371/68747470733a2f2f706f7365722e707567782e6f72672f66756e67696f2f457863656c42756e646c652f762f737461626c652e706e67)](https://packagist.org/packages/fungio/ExcelBundle)[![Latest Unstable Version](https://camo.githubusercontent.com/c26938626e702649b37bdaf313f59a7ad0db2af082d24b9518b3f2d4de4bb372/68747470733a2f2f706f7365722e707567782e6f72672f66756e67696f2f457863656c42756e646c652f762f756e737461626c652e706e67)](https://packagist.org/packages/fungio/ExcelBundle)

License
-------

[](#license)

[![License](https://camo.githubusercontent.com/1739c9935d18d968f8eba762affca36c5cff658b3632d8ebf232d5ab76ee2973/68747470733a2f2f706f7365722e707567782e6f72672f66756e67696f2f457863656c42756e646c652f6c6963656e73652e706e67)](LICENSE)

Version 2
---------

[](#version-2)

This is the **shiny** new version. There is a big BC with the 1.\* version, but **unit tests**, **functional tests**, and **the new factory** is very simple to use.

### Version 1.\*

[](#version-1)

If you have installed an old version, and you are happy to use it, you could find documentation and files in the [tag v1.0.6](https://github.com/fungio/ExcelBundle/releases/tag/v1.0.6), [browse the code](https://github.com/fungio/ExcelBundle/tree/cf0ecbeea411d7c3bdc8abab14c3407afdf530c4).

### Things to know:

[](#things-to-know)

CSV is faster so if you have to create simple xls file, I encourage you to use the built-in function for csv: [http://php.net/manual-lookup.php?pattern=csv&amp;lang=en&amp;scope=quickref](http://php.net/manual-lookup.php?pattern=csv&lang=en&scope=quickref)

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

[](#installation)

**1** Add to composer.json to the `require` key

```
    $composer require fungio/excelbundle
```

**2** Register the bundle in `app/AppKernel.php`

```
    $bundles = array(
        // ...
        new Fungio\ExcelBundle\FungioExcelBundle(),
    );
```

TL;DR
-----

[](#tldr)

- Create an empty object:

```
$phpExcelObject = $this->get('phpexcel')->createPHPExcelObject();
```

- Create an object from a file:

```
$phpExcelObject = $this->get('phpexcel')->createPHPExcelObject('file.xls');
```

- Create a Excel5 and write to a file given the object:

```
$writer = $this->get('phpexcel')->createWriter($phpExcelObject, 'Excel5');
$writer->save('file.xls');
```

- Create a Excel5 and create a StreamedResponse:

```
$writer = $this->get('phpexcel')->createWriter($phpExcelObject, 'Excel5');
$response = $this->get('phpexcel')->createStreamedResponse($writer);
```

- Create a Excel file with an image:

```
$writer = $this->get('phpexcel')->createPHPExcelObject();
$writer->setActiveSheetIndex(0);
$activesheet = $writer->getActiveSheet();

$drawingobject = $this->get('phpexcel')->createPHPExcelWorksheetDrawing();
$drawingobject->setName('Image name');
$drawingobject->setDescription('Image description');
$drawingobject->setPath('/path/to/image');
$drawingobject->setHeight(60);
$drawingobject->setOffsetY(20);
$drawingobject->setCoordinates('A1');
$drawingobject->setWorksheet($activesheet)
```

Not Only 'Excel5'
-----------------

[](#not-only-excel5)

The list of the types are:

1. 'Excel5'
2. 'Excel2007'
3. 'Excel2003XML'
4. 'OOCalc'
5. 'SYLK'
6. 'Gnumeric'
7. 'HTML'
8. 'CSV'

Example
-------

[](#example)

### Fake Controller

[](#fake-controller)

The best place to start is the fake Controller at `Tests/app/Controller/FakeController.php`, that is a working example.

### More example

[](#more-example)

You could find a lot of examples in the official PHPExcel repository

### For lazy devs

[](#for-lazy-devs)

```
namespace YOURNAME\YOURBUNDLE\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\ResponseHeaderBag;

class DefaultController extends Controller
{

    public function indexAction($name)
    {
        // ask the service for a Excel5
       $phpExcelObject = $this->get('phpexcel')->createPHPExcelObject();

       $phpExcelObject->getProperties()->setCreator("fungio")
           ->setLastModifiedBy("Giulio De Donato")
           ->setTitle("Office 2005 XLSX Test Document")
           ->setSubject("Office 2005 XLSX Test Document")
           ->setDescription("Test document for Office 2005 XLSX, generated using PHP classes.")
           ->setKeywords("office 2005 openxml php")
           ->setCategory("Test result file");
       $phpExcelObject->setActiveSheetIndex(0)
           ->setCellValue('A1', 'Hello')
           ->setCellValue('B2', 'world!');
       $phpExcelObject->getActiveSheet()->setTitle('Simple');
       // Set active sheet index to the first sheet, so Excel opens this as the first sheet
       $phpExcelObject->setActiveSheetIndex(0);

        // create the writer
        $writer = $this->get('phpexcel')->createWriter($phpExcelObject, 'Excel5');
        // create the response
        $response = $this->get('phpexcel')->createStreamedResponse($writer);
        // adding headers
        $dispositionHeader = $response->headers->makeDisposition(
            ResponseHeaderBag::DISPOSITION_ATTACHMENT,
            'stream-file.xls'
        );
        $response->headers->set('Content-Type', 'text/vnd.ms-excel; charset=utf-8');
        $response->headers->set('Pragma', 'public');
        $response->headers->set('Cache-Control', 'maxage=1');
        $response->headers->set('Content-Disposition', $dispositionHeader);

        return $response;
    }
}
```

Contributors
------------

[](#contributors)

the [list of contributors](https://github.com/fungio/ExcelBundle/graphs/contributors)

Contribute
----------

[](#contribute)

1. fork the project
2. clone the repo
3. get the coding standard fixer: `wget http://cs.sensiolabs.org/get/php-cs-fixer.phar`
4. before the PullRequest you should run the coding standard fixer with `php php-cs-fixer.phar fix -v .`

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 74.3% of commits — single point of failure

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 ~213 days

Recently: every ~453 days

Total

14

Last Release

2252d ago

Major Versions

v0.0.8 → v1.0.02012-09-28

v1.0.6 → v2.0.0-RC12013-12-06

v2.1.0 → 3.x-dev2020-04-30

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2470117?v=4)[Pierrick](/maintainers/fungio)[@fungio](https://github.com/fungio)

---

Top Contributors

[![liuggio](https://avatars.githubusercontent.com/u/530406?v=4)](https://github.com/liuggio "liuggio (101 commits)")[![szchen77](https://avatars.githubusercontent.com/u/1326435?v=4)](https://github.com/szchen77 "szchen77 (4 commits)")[![renatomefi](https://avatars.githubusercontent.com/u/823634?v=4)](https://github.com/renatomefi "renatomefi (4 commits)")[![TomasVotruba](https://avatars.githubusercontent.com/u/924196?v=4)](https://github.com/TomasVotruba "TomasVotruba (3 commits)")[![fungio](https://avatars.githubusercontent.com/u/2470117?v=4)](https://github.com/fungio "fungio (3 commits)")[![sethunath](https://avatars.githubusercontent.com/u/905031?v=4)](https://github.com/sethunath "sethunath (2 commits)")[![gnat42](https://avatars.githubusercontent.com/u/325591?v=4)](https://github.com/gnat42 "gnat42 (1 commits)")[![jebbench](https://avatars.githubusercontent.com/u/1029732?v=4)](https://github.com/jebbench "jebbench (1 commits)")[![lemoinem](https://avatars.githubusercontent.com/u/234992?v=4)](https://github.com/lemoinem "lemoinem (1 commits)")[![lvancrayelynghe](https://avatars.githubusercontent.com/u/1170965?v=4)](https://github.com/lvancrayelynghe "lvancrayelynghe (1 commits)")[![mmoreram](https://avatars.githubusercontent.com/u/521409?v=4)](https://github.com/mmoreram "mmoreram (1 commits)")[![mussbach](https://avatars.githubusercontent.com/u/57546580?v=4)](https://github.com/mussbach "mussbach (1 commits)")[![nursultanturdaliev](https://avatars.githubusercontent.com/u/1384060?v=4)](https://github.com/nursultanturdaliev "nursultanturdaliev (1 commits)")[![oscargala](https://avatars.githubusercontent.com/u/1231556?v=4)](https://github.com/oscargala "oscargala (1 commits)")[![pauvos](https://avatars.githubusercontent.com/u/984187?v=4)](https://github.com/pauvos "pauvos (1 commits)")[![ryzy](https://avatars.githubusercontent.com/u/994940?v=4)](https://github.com/ryzy "ryzy (1 commits)")[![s4brown](https://avatars.githubusercontent.com/u/1057294?v=4)](https://github.com/s4brown "s4brown (1 commits)")[![Vrtak-CZ](https://avatars.githubusercontent.com/u/112567?v=4)](https://github.com/Vrtak-CZ "Vrtak-CZ (1 commits)")[![Anyqax](https://avatars.githubusercontent.com/u/3055796?v=4)](https://github.com/Anyqax "Anyqax (1 commits)")[![waldo2188](https://avatars.githubusercontent.com/u/841872?v=4)](https://github.com/waldo2188 "waldo2188 (1 commits)")

---

Tags

bundleSymfony2excelxls

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fungio-excel-bundle/health.svg)

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

###  Alternatives

[liuggio/excelbundle

This is a Symfony2 Bundle helps you to read and write Excel files (including pdf, xlsx, odt), thanks to the PHPExcel library

3786.4M11](/packages/liuggio-excelbundle)[onurb/excel-bundle

Symfony Bundle to read or write Excel file (including pdf, xlsx, odt), using phpoffice/phpspreadsheet library (replacement of phpoffice/phpexcel, abandonned)

15333.4k](/packages/onurb-excel-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.

1175.2k](/packages/rcsofttech-audit-trail-bundle)[roromix/spreadsheetbundle

This is a Symfony 7.1+ Bundle helps you to read and write Spreadsheet files (including pdf, xls, xlsx, odt, csv), thanks to the PHPSpreadsheet library

24417.6k1](/packages/roromix-spreadsheetbundle)[jgrygierek/batch-entity-import-bundle

Importing entities with preview and edit features for Symfony.

101.1M1](/packages/jgrygierek-batch-entity-import-bundle)[jgrygierek/sonata-batch-entity-import-bundle

Importing entities with preview and edit features for Sonata Admin.

10955.3k](/packages/jgrygierek-sonata-batch-entity-import-bundle)

PHPackages © 2026

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