PHPackages                             nexterp/jasper-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. nexterp/jasper-reports

ActiveLibrary

nexterp/jasper-reports
======================

A Jasper Reports bridge for Laravel with Java 8 compatibility and pre-compiled templates.

v1.0.0(3mo ago)00MITRoffPHP &gt;=8.1

Since Jan 31Pushed 3mo agoCompare

[ Source](https://github.com/tinashekadiki/erp-reports)[ Packagist](https://packagist.org/packages/nexterp/jasper-reports)[ RSS](/packages/nexterp-jasper-reports/feed)WikiDiscussions main Synced 1mo ago

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

Jasper Reports for Laravel (NextERP)
====================================

[](#jasper-reports-for-laravel-nexterp)

A robust, enterprise-grade wrapper for Jasper Reports in Laravel, designed to seamlessly handle Java compatibility issues on modern systems (macOS Apple Silicon, Linux, etc.) by enforcing the use of Java 8.

🚀 Features
----------

[](#-features)

- **Java 8 Compatibility Engine**: Solves $ClassCastException$ issues by using a strictly defined local Java 8 binary.
- **Automated Binary Patching**: Automatically patches the underlying `jasperstarter` executable to use the local Java 8.
- **Enterprise Reports**: Includes pre-built templates for Trial Balance, Income Statement, Balance Sheet, Cash Flow, Changes in Equity, and General Ledger.

---

🛠 Step-by-Step Installation
---------------------------

[](#-step-by-step-installation)

Follow these steps to integrate Jasper Reports into your Laravel project.

### 1. Install Package

[](#1-install-package)

You can install this package via **Packagist** (recommended) or directly from **GitHub**.

#### Option A: via Packagist (Standard)

[](#option-a-via-packagist-standard)

Run the following command:

```
composer require nexterp/jasper-reports
```

#### Option B: via GitHub (Direct)

[](#option-b-via-github-direct)

Add the repository to your root `composer.json`:

```
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/tinashekadiki/erp-reports.git"
    }
],
```

Then run:

```
composer require nexterp/jasper-reports:dev-main
```

### 2. Auto-Update Setup (GitHub Hook)

[](#2-auto-update-setup-github-hook)

To ensure the package on Packagist stays in sync with your GitHub repository, set up the **GitHub Hook for Packagist**:

1. Go to your GitHub repository -&gt; **Settings** -&gt; **Webhooks**.
2. Click **Add webhook**.
3. Payload URL: `https://packagist.org/api/github?username=tinashekadiki`
4. Content type: `application/json`
5. Secret: *Your Packagist API Token*
6. Select "Just the push event" and click **Add webhook**.

---

### 3. Run Automated Setup

[](#3-run-automated-setup)

This package includes a setup script that automates Java 8 installation and binary patching for macOS and Linux.

```
# Navigate to the package directory (or run from root if scripts are synced)
cd vendor/nexterp/jasper-reports
chmod +x setup-jasper.sh
./setup-jasper.sh
```

*Note: Default setup password is `nexterp123`.*

### 4. Publish Resources

[](#4-publish-resources)

Publish the report templates and views to your application:

```
php artisan vendor:publish --tag=jasper-reports-templates
```

### 5. Finalize Environment

[](#5-finalize-environment)

Ensure your root `post-update-cmd.php` (if present) or `composer.json` scripts are configured to run patching on every `dump-autoload`. If you encounter Java errors, run:

```
composer dump-autoload
```

### 6. Rebuilding Reports

[](#6-rebuilding-reports)

If you modify the report templates (`.jrxml` files), you must recompile them to update the binary `.jasper` files. Use the provided rebuild script:

```
php rebuild_all_v3.php
```

This will scan the report directory and recompile all templates to ensure your changes are reflected in the generated output.

---

💻 Usage
-------

[](#-usage)

### Generating a Report

[](#generating-a-report)

Inject `JasperReportService` into your controller:

```
use Nexterp\JasperReports\JasperReportService;

public function __construct(JasperReportService $jasper) {
    $this->jasper = $jasper;
}

public function download() {
    $input = resource_path('reports/vendor/jasper-reports/trial_balance.jrxml');
    $output = storage_path('app/reports/trial_balance_'.time());
    $params = ['logo' => public_path('logo.png')];

    $path = $this->jasper->generateReport($input, $output, ['pdf'], $params);
    return response()->file($path);
}
```

---

📊 Included Reports
------------------

[](#-included-reports)

- **Trial Balance**: `trial_balance.jrxml`
- **Income Statement**: `income_statement.jrxml`
- **Balance Sheet**: `balance_sheet.jrxml`
- **Cash Flow**: `cash_flow.jrxml`
- **Changes in Equity**: `changes_in_equity.jrxml`
- **General Ledger**: `general_ledger.jrxml`

---

🔧 Troubleshooting
-----------------

[](#-troubleshooting)

ErrorCauseSolution`ClassCastException`System Java (17+) is used.Run `composer dump-autoload` to re-patch.`Logo not found`Invalid image path.Use absolute paths via `public_path()` or `resource_path()`.`Permission denied`Script lacks execution bits.Run `chmod +x setup-jasper.sh`.---

📜 License
---------

[](#-license)

MIT

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance80

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

107d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/66436372a456de9286cf81fa1ad91f9ded0e92e5c883bd2402c0cff710af943d?d=identicon)[prof.kadiki@gmail.com](/maintainers/prof.kadiki@gmail.com)

---

Top Contributors

[![tinashekadiki](https://avatars.githubusercontent.com/u/31509017?v=4)](https://github.com/tinashekadiki "tinashekadiki (5 commits)")

### Embed Badge

![Health badge](/badges/nexterp-jasper-reports/health.svg)

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

PHPackages © 2026

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