public function buildReportInputForm($reportUri, $targetRoute = null, $options = array()) {
        //Handle the options array
        $routeParameters = (isset($options['routeParameters']) && null != $options['routeParameters']) ? $options['routeParameters'] : array();
        $getICFrom = (isset($options['getICFrom']) && null != $options['getICFrom']) ? $options['getICFrom'] : $this->defaultInputOptionsSource;
        $data = (isset($options['data']) && null != $options['data']) ? $options['data'] : null;
        $formOptions = (isset($options['options']) && null != $options['options']) ? $options['options'] : array();

        //Get the options handler service
        $optionsHandler = $this->getOptionsHandler();

        //Create a new input control factory
        $icFactory = new InputControlFactory($optionsHandler, $getICFrom, 'Mesd\Jasper\ReportBundle\InputControl\\');

        //Load the input controls from the client using the factory and the options handler
        $inputControls = $this->jasperClient->getReportInputControl($reportUri, $getICFrom, $icFactory);
        //Build the form
        $form = $this->container->get('form.factory')->createBuilder('form', null, $formOptions);

        if ($targetRoute) {
            $form->setAction($this->container->get('router')->generate($targetRoute, $routeParameters));
        }

        //Set the method
        $form->setMethod('POST');

        //Add the input controls
        foreach ($inputControls as $inputControl) {
            if (null !== $data && array_key_exists($inputControl->getId(), $data)) {
                $inputControl->attachInputToFormBuilder($form, $data[$inputControl->getId()]);
            } else {
                $inputControl->attachInputToFormBuilder($form);
            }
        }

        //Add the submit button
        $form->add('Run', 'submit');

        //Return the completed form
        return $form->getForm();
    }
public function buildReportInputForm($reportUri, $targetRoute = null, $options = array()) {
        //Handle the options array
        $routeParameters = (isset($options['routeParameters']) && null != $options['routeParameters']) ? $options['routeParameters'] : array();
        $getICFrom = (isset($options['getICFrom']) && null != $options['getICFrom']) ? $options['getICFrom'] : $this->defaultInputOptionsSource;
        $data = (isset($options['data']) && null != $options['data']) ? $options['data'] : null;
        $formOptions = (isset($options['options']) && null != $options['options']) ? $options['options'] : array();

        //Get the options handler service
        $optionsHandler = $this->getOptionsHandler();

        //Create a new input control factory
        $icFactory = new InputControlFactory($optionsHandler, $getICFrom, 'Mesd\Jasper\ReportBundle\InputControl\\');

        //Load the input controls from the client using the factory and the options handler
        $inputControls = $this->jasperClient->getReportInputControl($reportUri, $getICFrom, $icFactory);
        //Build the form
        $form = $this->container->get('form.factory')->createBuilder('form', null, $formOptions);

        if ($targetRoute) {
            $form->setAction($this->container->get('router')->generate($targetRoute, $routeParameters));
        }

        //Set the method
        $form->setMethod('POST');

        //Add the input controls
        foreach ($inputControls as $inputControl) {
            if (null !== $data && array_key_exists($inputControl->getId(), $data)) {
                $inputControl->attachInputToFormBuilder($form, $data[$inputControl->getId()]);
            } else {
                $inputControl->attachInputToFormBuilder($form);
            }
        }

        //Add the submit button
        $form->add('Run', 'submit');

        //Return the completed form
        return $form->getForm();
    }
public function buildReportInputForm ( $ reportUri , $ targetRoute = null , $ options = array ( ) ) { //Handle the options array $ routeParameters = ( isset ( $ options [ 'routeParameters' ] ) && null != $ options [ 'routeParameters' ] ) ? $ options [ 'routeParameters' ] : array ( ) ; $ getICFrom = ( isset ( $ options [ 'getICFrom' ] ) && null != $ options [ 'getICFrom' ] ) ? $ options [ 'getICFrom' ] : $ this -> defaultInputOptionsSource ; $ data = ( isset ( $ options [ 'data' ] ) && null != $ options [ 'data' ] ) ? $ options [ 'data' ] : null ; $ formOptions = ( isset ( $ options [ 'options' ] ) && null != $ options [ 'options' ] ) ? $ options [ 'options' ] : array ( ) ; //Get the options handler service $ optionsHandler = $ this -> getOptionsHandler ( ) ; //Create a new input control factory $ icFactory = new InputControlFactory ( $ optionsHandler , $ getICFrom , 'Mesd\Jasper\ReportBundle\InputControl\\' ) ; //Load the input controls from the client using the factory and the options handler $ inputControls = $ this -> jasperClient -> getReportInputControl ( $ reportUri , $ getICFrom , $ icFactory ) ; //Build the form $ form = $ this -> container -> get ( 'form.factory' ) -> createBuilder ( 'form' , null , $ formOptions ) ; if ( $ targetRoute ) { $ form -> setAction ( $ this -> container -> get ( 'router' ) -> generate ( $ targetRoute , $ routeParameters ) ) ; } //Set the method $ form -> setMethod ( 'POST' ) ; //Add the input controls foreach ( $ inputControls as $ inputControl ) { if ( null !== $ data && array_key_exists ( $ inputControl -> getId ( ) , $ data ) ) { $ inputControl -> attachInputToFormBuilder ( $ form , $ data [ $ inputControl -> getId ( ) ] ) ; } else { $ inputControl -> attachInputToFormBuilder ( $ form ) ; } } //Add the submit button $ form -> add ( 'Run' , 'submit' ) ; //Return the completed form return $ form -> getForm ( ) ; }
Builds a symfony form from the inputs from the requested report uri

@param string  $reportUri   The uri of the report whose input controls to construct the form from
@param string  $targetRoute The route to serve as the action for the form
@param array   $options     Options array:
'getICFrom' => Where to get the control options from, else the default will be used
'routeParameters' => additional parameters to generate the action url with
'data' => data parameter for the form builder
'options' => array of options to send to the form builder

@return Symfony\Component\Form\Form The input controls form
Builds a symfony form from the inputs from the requested report uri