PHPackages                             superbig/craft-reports - 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. superbig/craft-reports

ActiveCraft-plugin[PDF &amp; Document Generation](/categories/documents)

superbig/craft-reports
======================

Write reports with Twig.

1.0.7(6y ago)512.1k1[13 issues](https://github.com/superbigco/craft-reports/issues)MITPHPCI passing

Since Mar 5Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/superbigco/craft-reports)[ Packagist](https://packagist.org/packages/superbig/craft-reports)[ RSS](/packages/superbig-craft-reports/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (8)Dependencies (2)Versions (17)Used By (0)

Reports for Craft CMS 5
=======================

[](#reports-for-craft-cms-5)

Write data reports in Twig and deliver them via email, CSV export, or queue jobs.

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

[](#requirements)

- Craft CMS 5.5+
- PHP 8.2+

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

[](#installation)

```
composer require superbig/craft-reports
```

Then install the plugin from the Craft Control Panel or run:

```
./craft plugin/install reports
```

Quick Start
-----------

[](#quick-start)

1. Go to **Reports** in the CP sidebar
2. Click **New** and give your report a name and handle
3. Write your report in Twig using the `result` variable:

```
{% set users = craft.users.lastLoginDate('> ' ~ now|date_modify('-30 days')|atom).all() %}

{% do result.setHeader(['Username', 'Name', 'Email']) %}
{% for user in users %}
    {% do result.append([user.username, user.getName(), user.email]) %}
{% endfor %}
```

4. Click **Run** to see the output, or **Export** to download as CSV

Configuration
-------------

[](#configuration)

Create a `config/reports.php` file to override defaults:

OptionTypeDefaultDescription`enableScheduler``bool``true`Enable the report scheduler`helpers``array``[]`Custom helper functions available in report templates`pluginName``string``'Reports'`Override the plugin name in the CP```
