PHPackages                             davidecaruso/jasper-php - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. davidecaruso/jasper-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

davidecaruso/jasper-php
=======================

PHP library to execute Jasper Reports

v1.0.2(8y ago)2222MITHTMLPHP &gt;=7.0.0

Since Feb 5Pushed 8y ago1 watchersCompare

[ Source](https://github.com/davidecaruso/jasper-php)[ Packagist](https://packagist.org/packages/davidecaruso/jasper-php)[ RSS](/packages/davidecaruso-jasper-php/feed)WikiDiscussions master Synced today

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

Jasper PHP
==========

[](#jasper-php)

PHP library to generate Jasper Reports.

Install
-------

[](#install)

```
$ composer require davidecaruso/jasper-php
```

This automatically installs and provides the [Jasper Starter](http://jasperstarter.cenote.de/) executable and the [MySQL Connector Driver](https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-installing.html). You can also pass to the library's constructor your **jasperstarter** file's path.

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

[](#requirements)

- PHP &gt;= 7.0
- Java &gt;= 1.8.0
- Jasper Starter (automatically provided by the Composer installation)

Usage
-----

[](#usage)

### Compile a *jrxml* file into a *jasper* file:

[](#compile-a-jrxml-file-into-a-jasper-file)

```
$jasper = new JasperPHP;
$jasper->compile('path/to/report.jrxml')->execute();
```

### Generate report via JSON connection:

[](#generate-report-via-json-connection)

```
$jasper = new JasperPHP;
$jasper->process(
    'path/to/report.jasper',
    null,
    ['csv'],
    [],
    [
        'driver' => 'json',
        'json_query' => 'data',
        'data_file' => 'path/to/data.json'
    ]
)->execute();
```

Example of *data.json* file:

```
{
  "data": [
    {
      "first-name": "Foo",
      "last-name": "Bar",
      "age": 32
    },
    {
      "first-name": "Baz",
      "last-name": "Foobar",
      "age": 16
    }
  ]
}
```

### Generate report via MySQL connection:

[](#generate-report-via-mysql-connection)

```
$jasper = new JasperPHP;
$jasper->process(
    'path/to/report.jasper',
    false,
    array('xlsx'),
    array(),
    array(
        'driver' => 'mysql',
        'username' => 'root',
        'password' => 'root',
        'host' => 'localhost',
        'database' => 'mydatabase',
        'port' => '3306',
    )
)->execute();
```

### Use an own executable Jasper Starter file:

[](#use-an-own-executable-jasper-starter-file)

```
$jasper = new JasperPHP('path/to/jasperstarter');
$jasper->compile('path/to/report.jrxml')->execute();
```

Author
------

[](#author)

[Davide Caruso](https://davidecaruso.github.io)

License
-------

[](#license)

Licensed under [MIT](https://opensource.org/licenses/mit-license.php).

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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 ~0 days

Total

3

Last Release

3016d ago

PHP version history (2 changes)v1.0.0PHP ^7.0

v1.0.2PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/90671d253c44820544894ff3fa1344fa2c4cdfb1e6b1e841d428b69ab8af418e?d=identicon)[davidecaruso](/maintainers/davidecaruso)

---

Top Contributors

[![davidecaruso](https://avatars.githubusercontent.com/u/7901308?v=4)](https://github.com/davidecaruso "davidecaruso (21 commits)")

---

Tags

composer-packagejasper-reportsjasperphpjasperreportsphpphp-library

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/davidecaruso-jasper-php/health.svg)

```
[![Health](https://phpackages.com/badges/davidecaruso-jasper-php/health.svg)](https://phpackages.com/packages/davidecaruso-jasper-php)
```

PHPackages © 2026

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