PHPackages                             conceptsandtraining/lib-excel-wrapper - 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. conceptsandtraining/lib-excel-wrapper

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

conceptsandtraining/lib-excel-wrapper
=====================================

1.0.1(11mo ago)020.5k2GPL-3.0PHP

Since May 8Pushed 11mo ago4 watchersCompare

[ Source](https://github.com/conceptsandtraining/lib-excel-wrapper)[ Packagist](https://packagist.org/packages/conceptsandtraining/lib-excel-wrapper)[ RSS](/packages/conceptsandtraining-lib-excel-wrapper/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (4)Versions (6)Used By (0)

Excel wrapper
=============

[](#excel-wrapper)

*A wrapper for a streaming excel-writer.*

**Contacts:** [Richard Klees](https://github.com/klees)

Writing files
-------------

[](#writing-files)

An excel-write has to implement a kind of functionality as defined.

- Create a writer object
- Define style for single column at any time
- Fill the sheet row by row
- Create new sheets and switch by name
- Save to given folder and filename

To fill the sheet row by row is a recommended feature to increase the speed on mass export of data. It will not be possible to step back to rows or single columns to change values or something else.

```
public function addRow(array $values) {
    $this->writer->addRow($values);
}
```

For designing the sheet, it is possible to give any column at any time a new style. E.g. in row 1 to 5 the colum A is bold and left orientated. Starting with row 6 it will only left orientated and not longer bold. This gives the opportunity to design column headers or highlight special values.

```
public function setColumnStyle(Style $style, $column) {
    $this->writer->setColumnStyle($column, $style);
};
```

It is possible to create new sheets and switch them by name. If you creating a new sheet, it will be automaticly the current.

```
public function createSheet($name) {
    $this->writer->createSheet($name);
}

Public function selectSheet($name) {
    $this->writer->setCurrentSheet($name);
}
```

Define Styles
-------------

[](#define-styles)

A column can be styled in a lot of ways. This wrapper includes the mostly used.

- Font family
- Font size
- Bold
- Italic
- Underline
- Text color
- Background color
- Orientation
- Border
- Border color

```
public function getNewStyle() {
    $style = new Style();
    $style ->setFontFamily('Aarial')
           ->setFontSize(12)
           ->setItalic(false)
           ->setBorder(Style::TOP);

    return $style;
}
```

Example for use
---------------

[](#example-for-use)

This is a small example for using this wrapper.

```
public function exportData($file_name, $file_path, array $header, array $values) {
    $writer = new Writer();
    $writer->setFileName($file_name);
    $writer->setPath($file_path);

    $header_style = $this->getHeaderStyle();
    $writer->setColumnStyle('A', $header_style);
    $write->addRow($header);

    $bold_style = $this->getBoldStyle();
    $basic_style = $this->getBasicStyle();

    $writer->setColumnStyle('A', $bold_style);
    $writer->setColumnStyle('B', $basic_style);
    foreach($values as $value) {
        $write->addRow($value);
    }

    $writer->setColumnStyle('A', $basic_style);
    $writer->setColumnStyle('B', $bold_style);
    foreach($values as $value) {
        $write->addRow($value);
    }

    $writer->saveFile();
    $write->close();
}

protected function getHeaderStyle() {
    $style = new Style()
    $style->setBold(true)
          ->setItalic(true);

    return $style;
}

protected function getBoldStyle() {
    $style = new Style()
    $style->setBold(true)

    return $style;
}

protected function getBsicStyle() {
    return new Style();
}
```

The xlsx sheet result might be look like this.

R\\CAB1***Content for header***2**Content in the first column**Content in the second column3**Content in the first column**Content in the second column4Content in the first column**Content in the second column**5Content in the first column**Content in the second column**

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance50

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 84.2% 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 ~643 days

Total

5

Last Release

353d ago

Major Versions

v0.4.1 → 1.0.02025-05-21

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/54e0bc8231c2cf5ff02bd2717d238840cfa8cc2e20ab4e2791ee8617a1fb505e?d=identicon)[nhaagen](/maintainers/nhaagen)

![](https://www.gravatar.com/avatar/07409093ffa514ecc54ee3298fcef5a368789df18cf2344325934127086b8042?d=identicon)[shecken](/maintainers/shecken)

![](https://www.gravatar.com/avatar/9901f65ff5f60c16a695d9f9e123b6697b50f03e80dbb81d0d7f24ea8047acf3?d=identicon)[daniwe4](/maintainers/daniwe4)

---

Top Contributors

[![shecken](https://avatars.githubusercontent.com/u/12557020?v=4)](https://github.com/shecken "shecken (48 commits)")[![daniwe4](https://avatars.githubusercontent.com/u/22291200?v=4)](https://github.com/daniwe4 "daniwe4 (3 commits)")[![klees](https://avatars.githubusercontent.com/u/10611082?v=4)](https://github.com/klees "klees (3 commits)")[![tbongers-cat](https://avatars.githubusercontent.com/u/117283193?v=4)](https://github.com/tbongers-cat "tbongers-cat (3 commits)")

---

Tags

excellib

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/conceptsandtraining-lib-excel-wrapper/health.svg)

```
[![Health](https://phpackages.com/badges/conceptsandtraining-lib-excel-wrapper/health.svg)](https://phpackages.com/packages/conceptsandtraining-lib-excel-wrapper)
```

###  Alternatives

[phpoffice/phpspreadsheet

PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine

13.9k293.5M1.3k](/packages/phpoffice-phpspreadsheet)[rap2hpoutre/fast-excel

Fast Excel import/export for Laravel

2.3k24.9M47](/packages/rap2hpoutre-fast-excel)[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k32.1M102](/packages/spatie-browsershot)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[spatie/simple-excel

Read and write simple Excel and CSV files

1.3k9.9M48](/packages/spatie-simple-excel)

PHPackages © 2026

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