PHPackages                             mesd/jasper-report-bundle - 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. mesd/jasper-report-bundle

ActiveSymfony-bundle[PDF &amp; Document Generation](/categories/documents)

mesd/jasper-report-bundle
=========================

Jasper Reports bundle

v1.0.12(8y ago)33.9k4[2 issues](https://github.com/MESD/JasperReportBundle/issues)[1 PRs](https://github.com/MESD/JasperReportBundle/pulls)1MITPHP

Since May 30Pushed 8y ago14 watchersCompare

[ Source](https://github.com/MESD/JasperReportBundle)[ Packagist](https://packagist.org/packages/mesd/jasper-report-bundle)[ RSS](/packages/mesd-jasper-report-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (19)Used By (1)

Overview
========

[](#overview)

The Jasper Report Bundle serves as a layer on top of the vanilla PHP MESD Jasper Client library to make it easier to integrate with Symfony applications. The bundle also contains extra features on top of the client library that make use of some of Symfon'y features and to provide extra tools when adding Jasper Report support to an application. Also, the report bundle is built to be compatible with an optional report viewer bundle that provides the views and controller to handle most of the common report bundle.

\###Features The report bundle and the client currently offer the following features:

- Ability to get a list of reports from the Jasper Server
- Report execution, with report output being saved to a local directory for later retrieval
- Input control option management that makes it easy to lock down options for particular input controls based on the user
- Converts report input to Symfony forms
- Save and retrieve past reports

\###Todo List

- Add support for Jasper Server Pro, currently only the community version is supported
- Add more tools to help with managing the report store

Installation
============

[](#installation)

Add Packages to Project via Composer

```
$ composer require mesd/jasper-report-bundle "~1.0"
```

After these have been added, perform a composer update to install the packages in your vendor directory. Register the Bundle in the App Kernel As with all other bundles, the report bundle will need to be registered in the application's app kernel.

```
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Mesd\Jasper\ReportBundle\MesdJasperReportBundle()
    )
}
```

\###Configuring Report History Issue console command

```
app/console doctrine:schema:update --env = [whereever] --dump-sql
```

... to review, and then ...

```
app/console doctrine:schema:update --env = [whereever] --force
```

to add the history table to your schema. You may need to add a mapping to your doctrine orm configuration if you have multiple entity managers.

**Important**: add /report-store (or other parent specified in the cache\_dir field of configuration) to .gitignore to avoid adding myriad reports to the repo.

\###Connecting to the Jasper Report Server The next step is to add in the connection details to the config file so that the bundle can establish a connection with the report server

```
#config.yml
mesd_jasper_report:
    connection:
        username: %jasper_username%
        password: %jasper_password%
        host: %jasper_host%
        port: %jasper_port%
```

Link to the Bundle's Routing File The report bundle uses some internal routes to handle the processing of report assets (images, charts, and graphs) and for exporting reports saved in the report store. Since Symfony's autoloader does not handle routing automatically, you must import the bundle's routing.yml file for it to function. To do so, add the following to your routing.yml in the app/config directory.

```
MESDJasperReportBundle:
    resource: "@MesdJasperReportBundle/Resources/config/routing.yml"
    prefix: /reportbundle
```

\###Setting the Configuration Options Finally, all that is left is to set the configuration options for the report bundle. Most options have a default value. There is only one required option that needs to be set: the bundle's configuration the name of the options handler service that was set up in the last step. Visit the configuration section later to get a list of the configuration settings the report bundle has.

Usage
=====

[](#usage)

\###Creating an Options Handler To allow application specific control of the options for select parameters, an options handler service can be created to handle this. To create a basic option handler, extend the AbstractOptionsHandler class from Mesd\\Jasper\\ReportBundle\\Interfaces\\AbstractOptionsHandler and implement the method 'registerFunctions' that set the internal method an array that is a function that returns an array of options keyed by the input control id. For example:

```
