2017 © Pedro Peláez
 

symfony-bundle jasper-report-viewer-bundle

Adds a viewer element to work with the mesd/jasper-report-bundle

image

mesd/jasper-report-viewer-bundle

Adds a viewer element to work with the mesd/jasper-report-bundle

  • Monday, November 20, 2017
  • by appdev@mesd.k12.or.us
  • Repository
  • 13 Watchers
  • 0 Stars
  • 3,295 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 15 Versions
  • 0 % Grown

The README.md

Overview

The report viewer serves as an additional layer on top of the Jasper Report Bundle and provides a visual interface for displaying and running reports, and viewing report history. It requires the Jasper Report Bundle in order to work., (*1)

Features

  • Provides a list of all reports a user can view
  • Provides an interface to handle report input
  • Displays reports and ajax loads their pages
  • UI for report history

Todo

  • [ ] Currently relies on a cdn for third party css and javascript, needs to be better integrated into the bundle
  • [ ] Tests are seriously needed

Installation

Install Report Bundle

The report viewer bundle requires the report bundle to have been set up in order to work. If the report bundle is not yet installed, go here, (*2)

Add to Composer

The first step is to add the bundle to the composer.json of the application., (*3)

"require": {
    "mesd/jasper-report-viewer-bundle": "~1.0"
}

Add to the AppKernel

In order for the application to load the bundle, it needs to be registered in the AppKernel., (*4)

public function registerBundles() {
    $bundles = array(
        ...
        new Mesd\Jasper\ReportViewerBundle\MesdJasperReportViewerBundle(),
    )
}

Add To Assetic

To have assets work, the bundle has to be registered with assetic. This is done in the config file where the rest of assetic is setup. Example:, (*5)

assetic:
    ...
    bundles:
        - MesdJasperReportViewerBundle

Import the Routing File

The final step is to include the report viewer's routing file in the main application's routing file. Look at the example below:, (*6)

MESDJasperReportViewerBundle:
    resource: "@MesdJasperReportViewerBundle/Resources/config/routing.yml"
    prefix: /reportviewer

Usage

To add links to the report home and report viewer use the following twig functions, (*7)

{# report home link #}
{{ mesd_jasper_reportviewer_home('Link Text') }}

{# report viewer link #}
{{ mesd_jasper_reportviewer_report_link('/reports/uri_of_report', 'Link Text') }}

{# stored report link #}
{{ mesd_jasper_reportviewer_stored_report_link('/reports/uri_of_report', 'requestId', 'Link Text') }}

These routes may also be used in controllers:, (*8)

    public function indexAction( Request $request ) {
        $sc = $this->get('security.context');
        if ( $sc->isGranted('ROLE_REPORT') ) {
            return $this->redirect($this->generateUrl('MesdJasperReportViewerBundle_home'));
        } 
    }

or:, (*9)

    public function indexAction( Request $request ) {
        $sc = $this->get('security.context');
        if ( $sc->isGranted('ROLE_REPORT') ) {
            return $this->redirect(
                $this->generateUrl(
                    'MesdJasperReportViewerBundle_home',
                    array( 'openInNewTab' => true )
                )
            );
    }

A further look at each function: - mesd_jasper_reportviewer_home(linkText, classes = ' ', openInNewTab = true) - linkText => The text to display on the link - classes => classes to apply to the anchor tag - openInNewTab => whether to open the link in a new tab/window or not - mesd_jasper_reportviewer_report_link(reportUri, linkText, classes = ' ', openInNewTab = true, hideHome = true) - reportUri => The uri of the report to open the report viewer to on the Jasper Server - linkText => The text display on the link - classes => classes to apply to the anchor tag - openInNewTab => whether to open the link in a new tab/window or not - hideHome => Whether to display navbar links to home and history - mesd_jasper_reportviewer_stored_report_link(reportUri, requestId, linkText, classes = ' ', openInNewTab = true, hideHome = true) - reportUri => The uri of the report to open the report viewer to on the Jasper Server - requestId => The request Id of the stored report - linkText => The text display on the link - classes => classes to apply to the anchor tag - openInNewTab => whether to open the link in a new tab/window or not - hideHome => Whether to display navbar links to home and history, (*10)

API Documentation

Generated documentation exists in the bundle under the docs directory., (*11)

License

This project is licensed under the MIT license. See the LICENSE.md file for more information., (*12)

The Versions

20/11 2017

dev-ormed

dev-ormed

Adds a viewer element to work with the mesd/jasper-report-bundle

  Sources   Download

MIT

The Requires

 

22/04 2016

2.0.x-dev

2.0.9999999.9999999-dev

Adds a viewer element to work with the mesd/jasper-report-bundle

  Sources   Download

MIT

The Requires

 

30/10 2015

v1.0.8

1.0.8.0

Adds a viewer element to work with the mesd/jasper-report-bundle

  Sources   Download

MIT

The Requires

 

07/05 2015

v1.0.7

1.0.7.0

Adds a viewer element to work with the mesd/jasper-report-bundle

  Sources   Download

MIT

The Requires

 

17/03 2015

dev-master

9999999-dev

Adds a viewer element to work with the mesd/jasper-report-bundle

  Sources   Download

MIT

The Requires

 

17/03 2015

v1.0.6

1.0.6.0

Adds a viewer element to work with the mesd/jasper-report-bundle

  Sources   Download

MIT

The Requires

 

09/03 2015

v1.0.5

1.0.5.0

Adds a viewer element to work with the mesd/jasper-report-bundle

  Sources   Download

MIT

The Requires

 

24/02 2015

v1.0.4

1.0.4.0

Adds a viewer element to work with the mesd/jasper-report-bundle

  Sources   Download

MIT

The Requires

 

24/02 2015

v1.0.3

1.0.3.0

Adds a viewer element to work with the mesd/jasper-report-bundle

  Sources   Download

MIT

The Requires

 

30/10 2014

v1.0.2

1.0.2.0

Adds a viewer element to work with the mesd/jasper-report-bundle

  Sources   Download

MIT

The Requires

 

24/10 2014

v1.0.1

1.0.1.0

Adds a viewer element to work with the mesd/jasper-report-bundle

  Sources   Download

MIT

The Requires

 

23/10 2014

v1.0.0

1.0.0.0

Adds a viewer element to work with the mesd/jasper-report-bundle

  Sources   Download

MIT

The Requires

 

10/07 2014

1.0.0-alpha-002

1.0.0.0-alpha002

Adds a viewer element to work with the mesd/jasper-report-bundle

  Sources   Download

MIT

The Requires

 

10/07 2014

1.0.0-alpha-001

1.0.0.0-alpha001

Adds a viewer element to work with the mesd/jasper-report-bundle

  Sources   Download

MIT

The Requires

 

31/05 2014

0.9

0.9.0.0

Adds a viewer element to work with the mesd/jasper-report-bundle

  Sources   Download

MIT

The Requires