PHPackages                             hstanleycrow/easyphpreports - 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. hstanleycrow/easyphpreports

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

hstanleycrow/easyphpreports
===========================

PHP library to generate Excel, CSV and PDF reports from tabular data definitions, built on PhpSpreadsheet and mPDF.

v1.1.1(1mo ago)04MITPHPPHP ^8.2

Since Dec 19Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/hstanleycrow/EasyPHPReports)[ Packagist](https://packagist.org/packages/hstanleycrow/easyphpreports)[ Docs](https://github.com/hstanleycrow/EasyPHPReports)[ RSS](/packages/hstanleycrow-easyphpreports/feed)WikiDiscussions main Synced 1w ago

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

EasyPHPReports
==============

[](#easyphpreports)

PHP library to generate **Excel, CSV and PDF** reports (plus ready-to-embed HTML) from plain tabular data. It is a thin, opinionated layer on top of [PhpSpreadsheet](https://github.com/PHPOffice/PhpSpreadsheet) and [mPDF](https://github.com/mpdf/mpdf): you describe the columns once and hand over an array of rows, and the library takes care of headers, number/date formatting, column sizing and summary totals.

- **Spanish version:** [README.es.md](README.es.md)
- **AI consumption spec:** [AI\_USAGE.md](AI_USAGE.md) · [AI\_USAGE.es.md](AI_USAGE.es.md)

Features
--------

[](#features)

- One definition, four outputs: on-screen HTML table, `.xlsx`, `.csv`, `.pdf`.
- Per-column formats: text, number, decimal, money, date, datetime.
- Optional summary row per column (`SUM` for numeric, `COUNTIF` for text/date).
- Automatic date conversion, column auto-sizing and word-wrap for long values.
- No database required — it works with any array of rows, wherever they come from.

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

[](#requirements)

- PHP `^8.2`
- `ext-zip` (required by PhpSpreadsheet to write `.xlsx`)
- `ext-gd` and `ext-mbstring` (required by mPDF to write `.pdf`)

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

[](#installation)

```
composer require hstanleycrow/easyphpreports
```

Quick start
-----------

[](#quick-start)

The library only needs two things: a **columns definition** and an **array of rows**. Each row is an associative array whose values are read **in order** — the keys are up to you, but the value order must match the columns definition.

```
