public function getReportView($reportUri, $format = 'html') {
        if ($this->isConnected()) {
            //Create an event with default params and pass it to the event listener to process
            $reportViewerEvent = new ReportViewerRequestEvent($format, 1);
            $this->eventDispatcher->dispatch('Mesd.jasperreport.report_viewer_request', $reportViewerEvent);
            if ($reportViewerEvent->isPropagationStopped()) {
                if ($reportViewerEvent->isAsset()) {
                    return $this->getReportAsset($reportViewerEvent->getAssetUri(), $reportViewerEvent->getJSessionId());
                } else {
                    $params = '&page=' . $reportViewerEvent->getReportPage();
                    $format = $reportViewerEvent->getReportFormat();
                }
            } else {
                $params = '&page=1';
            }

            //Create new report object
            $report = new Report($reportUri, $format);

            //Create the builder
            $reportBuilder = new ReportBuilder(
                $this->jasperClient
                , $report
                , $params
                , $this->router->getMatcher()->getContext()->getBaseUrl() . $this->router->getMatcher()->getContext()->getPathInfo() . '?asset=true'
                , 'Fallback'
           );

            return $reportBuilder;
        } else {
            return false;
        }
    }
public function getReportView($reportUri, $format = 'html') {
        if ($this->isConnected()) {
            //Create an event with default params and pass it to the event listener to process
            $reportViewerEvent = new ReportViewerRequestEvent($format, 1);
            $this->eventDispatcher->dispatch('Mesd.jasperreport.report_viewer_request', $reportViewerEvent);
            if ($reportViewerEvent->isPropagationStopped()) {
                if ($reportViewerEvent->isAsset()) {
                    return $this->getReportAsset($reportViewerEvent->getAssetUri(), $reportViewerEvent->getJSessionId());
                } else {
                    $params = '&page=' . $reportViewerEvent->getReportPage();
                    $format = $reportViewerEvent->getReportFormat();
                }
            } else {
                $params = '&page=1';
            }

            //Create new report object
            $report = new Report($reportUri, $format);

            //Create the builder
            $reportBuilder = new ReportBuilder(
                $this->jasperClient
                , $report
                , $params
                , $this->router->getMatcher()->getContext()->getBaseUrl() . $this->router->getMatcher()->getContext()->getPathInfo() . '?asset=true'
                , 'Fallback'
           );

            return $reportBuilder;
        } else {
            return false;
        }
    }
public function getReportView ( $ reportUri , $ format = 'html' ) { if ( $ this -> isConnected ( ) ) { //Create an event with default params and pass it to the event listener to process $ reportViewerEvent = new ReportViewerRequestEvent ( $ format , 1 ) ; $ this -> eventDispatcher -> dispatch ( 'Mesd.jasperreport.report_viewer_request' , $ reportViewerEvent ) ; if ( $ reportViewerEvent -> isPropagationStopped ( ) ) { if ( $ reportViewerEvent -> isAsset ( ) ) { return $ this -> getReportAsset ( $ reportViewerEvent -> getAssetUri ( ) , $ reportViewerEvent -> getJSessionId ( ) ) ; } else { $ params = '&page=' . $ reportViewerEvent -> getReportPage ( ) ; $ format = $ reportViewerEvent -> getReportFormat ( ) ; } } else { $ params = '&page=1' ; } //Create new report object $ report = new Report ( $ reportUri , $ format ) ; //Create the builder $ reportBuilder = new ReportBuilder ( $ this -> jasperClient , $ report , $ params , $ this -> router -> getMatcher ( ) -> getContext ( ) -> getBaseUrl ( ) . $ this -> router -> getMatcher ( ) -> getContext ( ) -> getPathInfo ( ) . '?asset=true' , 'Fallback' ) ; return $ reportBuilder ; } else { return false ; } }
can be passed to the MesdJasperReportBundle_report_view twig function to automatically render the controls and report
can be passed to the MesdJasperReportBundle_report_view twig function to automatically render the controls and report