mardi 23 février 2016

our report has an error and couldn't be processed! Try to output the command using the function `output();` and run it manually in the console

If you have some time to replay to me. I try to use JasperPHP in Laravel 5 but can't. I make sample report with static text: test report But when I publish it and start with Laravel with that code:

    $output = public_path() . '/report/Test';
    $ext = "pdf";
    $jasper = JasperPHP::compile(
        public_path() . '/reports/Test.jasper',
        true
    )->execute();

    header('Content-Description: File Transfer');
    header('Content-Type: application/octet-stream');
    header('Content-Disposition: attachment; filename='.time().'Test.'.$ext);
    header('Content-Transfer-Encoding: binary');
    header('Expires: 0');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: public');
    header('Content-Length: ' . filesize($output.'.'.$ext));
    flush();
    readfile($output.'.'.$ext);
    unlink($output.'.'.$ext); // deletes the temporary file

And Laravel gives me an error:

Exception in JasperPHP.php line 178: Your report has an error and couldn't be processed! Try to output the command using the function output(); and run it manually in the console.

Can you help me? What I do wrong? I would like to generate pdf file for that report and send it to client.

Also one more question. How to send param to report?

TNX.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire