PHPackages                             mobiledev-pro/excelbundle - 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. mobiledev-pro/excelbundle

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

mobiledev-pro/excelbundle
=========================

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(9y ago)011MITPHPPHP &gt;=5.3.2

Since Sep 28Pushed 7y ago1 watchersCompare

[ Source](https://github.com/MobileDev-pro/ExcelBundle)[ Packagist](https://packagist.org/packages/mobiledev-pro/excelbundle)[ Docs](http://www.welcometothebundle.com)[ RSS](/packages/mobiledev-pro-excelbundle/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (9)Versions (15)Used By (0)

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

[](#symfony2-excel-bundle)

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

[![Build Status](https://camo.githubusercontent.com/70f4697cd1fc0bdb140ea96196cdef3da34f33c4fca0163307efc1659d6800fe/68747470733a2f2f7472617669732d63692e6f72672f6c69756767696f2f457863656c42756e646c652e706e67)](https://travis-ci.org/liuggio/ExcelBundle)[![Total Downloads](https://camo.githubusercontent.com/664026f1957d190ccbda6f5696da9000b97cf117d376150bcd11e16d8c2f1c10/68747470733a2f2f706f7365722e707567782e6f72672f6c69756767696f2f457863656c42756e646c652f646f776e6c6f6164732e706e67)](https://packagist.org/packages/liuggio/ExcelBundle)[![Latest Stable Version](https://camo.githubusercontent.com/82b01663133dd13d1e8356926263311de29b89a43f2e0c642f05e0970ed38445/68747470733a2f2f706f7365722e707567782e6f72672f6c69756767696f2f457863656c42756e646c652f762f737461626c652e706e67)](https://packagist.org/packages/liuggio/ExcelBundle)[![Latest Unstable Version](https://camo.githubusercontent.com/15e7b9316925469b8b28949cd698a28c3dff3ba23b73182d9523e4bea4399cf6/68747470733a2f2f706f7365722e707567782e6f72672f6c69756767696f2f457863656c42756e646c652f762f756e737461626c652e706e67)](https://packagist.org/packages/liuggio/ExcelBundle)

License
-------

[](#license)

[![License](https://camo.githubusercontent.com/355ef41136ce991e2d980ebf52f04ee73589c7a9f2f7d1d311c7cac75f75a025/68747470733a2f2f706f7365722e707567782e6f72672f6c69756767696f2f457863656c42756e646c652f6c6963656e73652e706e67)](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/liuggio/ExcelBundle/releases/tag/v1.0.6), [browse the code](https://github.com/liuggio/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 liuggio/excelbundle
```

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

```
    $bundles = array(
        // ...
        new Liuggio\ExcelBundle\LiuggioExcelBundle(),
    );
```

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("liuggio")
           ->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/liuggio/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

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 75.4% 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 ~113 days

Recently: every ~185 days

Total

13

Last Release

3617d ago

Major Versions

v0.0.8 → v1.0.02012-09-28

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

### Community

Maintainers

![](https://www.gravatar.com/avatar/96923cb7a3ddaa095379205d7579d2181423a7f9ecd7ca91a4025ccbe0b66947?d=identicon)[MobileD-pro](/maintainers/MobileD-pro)

---

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)")[![sethunath](https://avatars.githubusercontent.com/u/905031?v=4)](https://github.com/sethunath "sethunath (2 commits)")[![dxops](https://avatars.githubusercontent.com/u/1804871?v=4)](https://github.com/dxops "dxops (1 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)")[![MobileD-pro](https://avatars.githubusercontent.com/u/29793350?v=4)](https://github.com/MobileD-pro "MobileD-pro (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)")

---

Tags

bundleSymfony2excelxls

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mobiledev-pro-excelbundle/health.svg)

```
[![Health](https://phpackages.com/badges/mobiledev-pro-excelbundle/health.svg)](https://phpackages.com/packages/mobiledev-pro-excelbundle)
```

###  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

3776.4M10](/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)

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

24410.2k1](/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.

10951.2k](/packages/jgrygierek-sonata-batch-entity-import-bundle)[phpnt/yii2-export

Yii2 It saves data in xls, csv, word, html, pdf files.

158.9k](/packages/phpnt-yii2-export)

PHPackages © 2026

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