yohkenn/symfony-jasper-report-bundle

This package is abandoned and no longer maintained. The author suggests using the yoh/symfony-jasper-report-bundle package instead.

Symfony 3 Bundle integrating the Jasper Server REST v2 client (Jaspersoft/rest-client)

Installs: 220

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 3

Forks: 4

Open Issues: 0

Type:symfony-bundle

v1.2 2017-05-19 08:57 UTC

This package is not auto-updated.

Last update: 2022-02-01 13:00:16 UTC


README

The JasperReportBundle requires jaspersoft/rest-client and provides an JasperReport-Client as service in the Symfony service container.

Installation

1 Add bundle to composer.json:

    composer require yoh/symfony-jasper-report-bundle

2 Register bundle in app/AppKernel.php:

    $bundle = [
            ...
    		new Yoh\JasperReportBundle\YohJasperReportBundle(),
            ...
    ];

3 Add parameter to app/config/config.yml

    yoh_jasper_report:
        jrs_host:      "%jrs_host%"
        jrs_port:      "%jrs_port%"
        jrs_base:      "%jrs_base%"
        jrs_username:  "%jrs_username%"
        jrs_password:  "%jrs_password%"
        jrs_org_id:    "%jrs_org_id%"

4 Add a dummy configuration in app/config/parameters.yml.dist

    jrs_host:      127.0.0.1
    jrs_port:      8080
    jrs_base:      jasperserver
    jrs_username:  jasperadmin
    jrs_password:  jasperadmin
    jrs_org_id:    null

5 Add your own configuration in app/config/parameters.yml

Usage

You can now access the Client object via the Symfony service yoh.jasper.report:

    $client = $this->get('yoh.jasper.report')->getJasperClient();

Using Report Service :

    $reportService = $client()->reportService();

So a controller giving back a pdf-report would look like

    public function reportAction(Request $request)
    {
    	$format = "pdf";
        $reportUnit = "/reports/sampleReport";
        $params = array(
            "Custom Label 1" => "Custom Value 1",
            "Custom Label 2" => "Custom Value 2"
        );

        return $this->get('yoh.jasper.report')->generate($reportUnit, $format, $params);
    }