PHPackages                             frvaillant/entitytoexcel - 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. frvaillant/entitytoexcel

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

frvaillant/entitytoexcel
========================

Adds symfony command to export entities as excel file

1.0.2(5y ago)217MITPHPPHP ^7.2

Since Nov 21Pushed 5y ago2 watchersCompare

[ Source](https://github.com/frvaillant/EntityToExcel)[ Packagist](https://packagist.org/packages/frvaillant/entitytoexcel)[ RSS](/packages/frvaillant-entitytoexcel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

EntityToExcel
=============

[](#entitytoexcel)

This package adds a command to your symfony project. You'll be able to export excel files representing your entities in order to help you to fill database with client data.
This program doesn't export any data. It just export structure of your data inb order to help you and/or your clients to give you data well formatted before import them.

Requirements
============

[](#requirements)

Symfony &gt; 4.4
php &gt; 7.0

Read before
===========

[](#read-before)

This software is free to use, modify and share. It's made with a lot of love but comes without any guarantee.

Install
=======

[](#install)

first run `composer require frvaillant/entitytoexcel`

Edit your `config/services.yaml` file and add under services key :

```
services:
   EntityToExcel\Command\EntityToCsvCommand:
           tags:
               - { name: 'console.command', command: 'entity:excel' }
```

run
===

[](#run)

launch command in your terminal :
`php bin/console entity:excel Entity`
Replace Entity by the name of the entity you want to export as excel file

The file is exported as `Entity.xlsx` in the public/xls directory

Excel file description
======================

[](#excel-file-description)

Each property of your entity is reported on each column of the table.
On the first line, the name of the property
On the second line, the display name (if you choose some (see below))
On the third line, the default values

Get more
========

[](#get-more)

The package comes with an annotation class wich allows you to be more precise
Use it with `@EtEx()`

- **exclude field**
    If you want to exclude one of your entity properties from your excel file :

```
    /**
     * @EtEx(exclude=true)
     * @ORM\Column(type="string", length=255)
     */
    private $name;
```

- **Add a dropdown value selector**
    if you want to add choices to fill cells, you can add a list parameter as below

```
    /**
     * @EtEx(list={"1", "0"}, defaultValue="0")
     * @ORM\Column(type="boolean")
     */
    private $isMusician;
```

- **Add a dropdown selector from another entity**
    If your property is for example a ManyToOne Relation with another entity, you can list the values from your entity usin the listFromEntityWith argument.
    This argument needs the name of the field you want to use to list your linked entity.

```
     /**
     * @EtEx(listFromEntityWith="name")
     * @ORM\ManyToOne(targetEntity=Category::class, inversedBy="companies")
     * @ORM\JoinColumn(nullable=true)
     */
    private $category;
```

- **Default value**
    You can add a default value. This value will fill the cell on the third line as an example.

```
    /**
     * @EtEx(defaultValue="My value")
     * @ORM\Column(type="string")
     */
    private $label;
```

- **display name**
    By default, the title of each column is the name of the property in the entity.
    But sometimes, you'll probably want to display a translation of the terms used in entity definition.
    To do this, you can add a displayName paramater

```
       /**
        * @EtEx(displayName="Service maître")
        * @ORM\Column(type="array", nullable=true)
        */
       private $headService;
```

- **Add sheets from other entities**If your entity is linked with some others. For example your entity "Person" represents some persons, and some of them are musicians.
    You probably need some more informations about musicians wich are represented by the "Musician" entity.
    With the `includeFields` parameter, you will generate another sheet in your excel file with the properties of the Musician entity.

```
    /**
     * @EtEx(includeFields=true, displayName="Precision if this person is musician")
     * @ORM\OneToOne(targetEntity=Musician::class, cascade={"persist", "remove"})
     */
    private $musicianPrecision;
```

You can use one of the above parameters, and of course you can use as much filters as you like

```
    /**
     * @EtEx(list={"0", "1", "2"}, displayName="your word", defaultValue="1")
     */
```

Future development
==================

[](#future-development)

The reverse side of this program is on the way in order to import data following excel files.
To be continued ...

Feel free to report any encountered problem using issues on github
Github repository :

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~1 days

Total

3

Last Release

1994d ago

### Community

Maintainers

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

---

Top Contributors

[![frvaillant](https://avatars.githubusercontent.com/u/33039316?v=4)](https://github.com/frvaillant "frvaillant (24 commits)")

---

Tags

phpsymfonyexportexcelentity

### Embed Badge

![Health badge](/badges/frvaillant-entitytoexcel/health.svg)

```
[![Health](https://phpackages.com/badges/frvaillant-entitytoexcel/health.svg)](https://phpackages.com/packages/frvaillant-entitytoexcel)
```

###  Alternatives

[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.7k144.3M710](/packages/maatwebsite-excel)[jgrygierek/batch-entity-import-bundle

Importing entities with preview and edit features for Symfony.

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

PHPackages © 2026

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