Php laravel with jasper report

5

I'm using laravel as a framework, and jasperphp to generate the report, however I can not pass the database to jasper, most uses mysql to generate the report, but I'm using Mssql, someone gives me a light with it Please, of the two forms that I try to pass the bank the report is not generated.

 $my_where = "where cast(Data_concluido as date) >= $dataInicio AND cast(Data_concluido as date) <= $dataFim AND pes.tipo = $tipo AND pes.Empresa = $empresa" ;

    $my_where = '"' .  $my_where . '"'; 


   $database = [
        'driver' => 'sqlsrv',
        'username' => 'username',            
        'password' => 'password',            
        'jdbc_driver' => 'net.sourceforge.jtds.jdbc.Driver',
        'jdbc_url' => 'jdbc:jtds:sqlserver://localhost/database'
    ];
     $filename = time();

    JasperPHP::process(base_path() . '/app/reports/PesagemEntrada.jasper', 
    base_path() . '/app/reports/PesagemEntrada.jasper' . $filename,
    array("pdf"), //array("pdf", "rtf"), para gerar pdf e word  
    array("my_where" =>  $my_where), 
    $database
    )->execute();

I tried this way too:

 JasperPHP::process(base_path() . '/app/reports/PesagemEntrada.jasper', 
    base_path() . '/app/reports/PesagemEntrada.jasper' . $filename,
    array("pdf"), //array("pdf", "rtf"), para gerar pdf e word  
    array("my_where" =>  $my_where), 
    \Config::get('database.connections.sqlsrv')
    )->execute();

The query from my jrxml:

    <queryString>
    <![CDATA[SELECT                                         
                                pes.Cod_pesagem,
                                pes.Peso_bruto,
                                pes.Peso_tara,
                                pes.Peso_liquido,
                                pes.Peso_rejeito,
                                pes.tipo,                                     
                                CONVERT(nvarchar(30), pes.Databruto, 103) as Databruto,
                                CONVERT(nvarchar(30), pes.Datatara, 103) as Datatara,
                                pes.Placa,              
                                pn.cod_pn,
                                pn.parceiros_negocio,
                                prod.Cod_Produto,
                                prod.Produto,
                                motor.cod_motorista,
                                motor.motorista,
                                emp.cod_empresa,
                                emp.empresa

                                        FROM
                                        PESAGEM pes
                                        INNER JOIN EMPRESA as emp ON (pes.Empresa = emp.cod_empresa)
                                        INNER JOIN PARCEIRO_NEGOCIO pn ON (pes.Cod_PN = pn.cod_pn)
                                        INNER JOIN PRODUTO prod ON (pes.Cod_Produto = prod.Cod_Produto)
                                        INNER JOIN MOTORISTA motor ON (pes.Cod_Motorista = motor.cod_motorista) 
                                        $P!{my_where}]]>
    
asked by anonymous 15.09.2015 / 20:54

0 answers