PHP code example of yohkenn / symfony-jasper-report-bundle

1. Go to this page and download the library: Download yohkenn/symfony-jasper-report-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

yohkenn / symfony-jasper-report-bundle example snippets


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

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

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

    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);
    }