2017 © Pedro Peláez
 

library jasper-php

PHP library to execute Jasper Reports

image

davidecaruso/jasper-php

PHP library to execute Jasper Reports

  • Friday, March 16, 2018
  • by davidecaruso
  • Repository
  • 1 Watchers
  • 1 Stars
  • 34 Installations
  • HTML
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Jasper PHP

PHP library to generate Jasper Reports., (*1)

Install

$ composer require davidecaruso/jasper-php

This automatically installs and provides the Jasper Starter executable and the MySQL Connector Driver. You can also pass to the library's constructor your jasperstarter file's path., (*2)

Requirements

  • PHP >= 7.0
  • Java >= 1.8.0
  • Jasper Starter (automatically provided by the Composer installation)

Usage

Compile a jrxml file into a jasper file:

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

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:, (*3)

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

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:

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

Author

Davide Caruso, (*4)

License

Licensed under MIT., (*5)

The Versions

16/03 2018

dev-develop

dev-develop

PHP library to execute Jasper Reports

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

by Davide Caruso

16/03 2018

dev-master

9999999-dev

PHP library to execute Jasper Reports

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

by Davide Caruso

05/02 2018

v1.0.2

1.0.2.0

PHP library to execute Jasper Reports

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

by Davide Caruso

05/02 2018

v1.0.1

1.0.1.0

PHP library to execute Jasper Reports

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Davide Caruso

05/02 2018

v1.0.0

1.0.0.0

PHP library to execute Jasper Reports

  Sources   Download

MIT

The Requires

 

The Development Requires

by Davide Caruso