PHPackages                             stesa/phpjasper - 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. stesa/phpjasper

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

stesa/phpjasper
===============

A Laravel package for generating reports with JasperReports using the latest version of JasperStarter

v1.1.0(7mo ago)094MITPHPPHP ^8.0|^8.1|^8.2|^8.3|^8.4

Since Oct 14Pushed 7mo agoCompare

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

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

PHPJasper
=========

[](#phpjasper)

[![Latest Stable Version](https://camo.githubusercontent.com/f4b6f6281032af30dc187851604f9ade112025e484a74e9d9935fdb0bba2066e/68747470733a2f2f706f7365722e707567782e6f72672f73746573612f7068706a61737065722f762f737461626c65)](https://packagist.org/packages/stesa/phpjasper)[![Total Downloads](https://camo.githubusercontent.com/30e36b29ee05c1df3703f45a3522863c8244df48b65ec946953958ed66e61d59/68747470733a2f2f706f7365722e707567782e6f72672f73746573612f7068706a61737065722f646f776e6c6f616473)](https://packagist.org/packages/stesa/phpjasper)[![License](https://camo.githubusercontent.com/814aa38d6cec3487b61bb88f363a85e0d33d450f9a8897ae500529b54c03dfa2/68747470733a2f2f706f7365722e707567782e6f72672f73746573612f7068706a61737065722f6c6963656e7365)](https://packagist.org/packages/stesa/phpjasper)

A Laravel package for generating reports with JasperReports using the latest version of JasperStarter. Generate beautiful PDF, Excel, CSV, HTML, and other format reports from your Laravel application with ease.

Features
--------

[](#features)

- **Latest JasperReports**: Uses JasperReports 7.0.3 via custom [JasperStarter](https://github.com/ssamoy/jasperstarter) build
- **Multiple Output Formats**: PDF, Excel (XLS/XLSX), CSV, HTML, XML, and more
- **Database Support**: MySQL and PostgreSQL out of the box
- **Fluent API**: Intuitive, Laravel-style chainable methods
- **Barcode Support**: Full support for barcodes including Code128, Code39, QR codes, etc.
- **JSON Output**: Structured error handling and detailed logging
- **Easy Integration**: Automatic service provider discovery, facade support
- **Comprehensive**: Report compilation, execution, and parameter listing

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

[](#requirements)

- PHP 8.0 or higher
- Laravel 9.0, 10.0, 11.0, or 12.0
- Java Runtime Environment (JRE) 24 or higher

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

[](#installation)

### 1. Install via Composer

[](#1-install-via-composer)

```
composer require stesa/phpjasper
```

### 2. Publish Configuration (Optional)

[](#2-publish-configuration-optional)

```
php artisan vendor:publish --provider="Stesa\PHPJasper\PHPJasperServiceProvider" --tag="config"
```

This will create `config/phpjasper.php` for customization.

### 3. Publish Example Templates (Optional)

[](#3-publish-example-templates-optional)

```
php artisan vendor:publish --provider="Stesa\PHPJasper\PHPJasperServiceProvider" --tag="examples"
```

### 4. Verify Java Installation

[](#4-verify-java-installation)

Make sure Java is installed and accessible:

```
java -version
```

You should see Java 24 or higher.

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

[](#quick-start)

### Basic Usage

[](#basic-usage)

```
use Stesa\PHPJasper\Facades\PHPJasper;

// Compile a JRXML template
PHPJasper::compile(storage_path('app/reports/templates/invoice.jrxml'))
    ->execute();

// Generate a PDF report
PHPJasper::process(
    storage_path('app/reports/templates/invoice.jrxml'),
    storage_path('app/reports/output/invoice'),
    [
        'format' => 'pdf',
        'db_connection' => [
            'driver' => 'mysql',
            'host' => 'localhost',
            'database' => 'mydb',
            'username' => 'root',
            'password' => 'secret'
        ]
    ]
)->execute();

// Download the report
return response()->download(storage_path('app/reports/output/invoice.pdf'));
```

### Using in Controller

[](#using-in-controller)

```
