I have the following code in PHP under Laravel I need to pass the id of the invoice and the name of the account. but it does not work. it only allows me to send a single parameter in the array. if I remove the $ account-> name, it works perfect for me.
Error generated with 2 parameters
Exception in JasperPHP.php line 187:
Your report has failed and could not be worked! Try to output the command using the function output();
and run it manually in the console.
public function compilarFacturaOficina($grupo, $cabezera , $archivo ){
$ruta = '/public/comprobantes/facturas/';
$archivoCompilado = 'Blank_A4';
$user_id = Auth::user()->id;
$cuenta = Cuenta::find($cabezera->cuenta_id);
switch ($grupo) {
case 9927:
// Crear el objeto JasperPHP
$jasper = new JasperPHP;
//dd($factura_id);
$jasper->process(
base_path($ruta . $archivoCompilado),
false,
array('pdf', 'rtf', 'html' ,'xls'),
array('factura_id' => $cabezera->id , 'cuenta' => $cuenta->nombre)
)->execute();
break;
default:
# code...
break;
}
}