#1 2016-02-23 15:07:02

stojankukrika
Member
Registered: 2016-02-23

Exception in JasperPHP.php line 178

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](https://cloud.githubusercontent.com/ass … ed2482.png)
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.

Offline

#2 2016-02-23 15:36:58

Arno Mittelbach
datenwerke
Registered: 2012-02-14

Re: Exception in JasperPHP.php line 178

Hi,

I am afraid you are in the wrong forum. Maybe try contacting cossou directly (https://github.com/cossou/JasperPHP). Taking a wild guess, I'd say, have a look at your jasper report, whether that compiles and works. Of course, I can also recommend looking at ReportServer as an alternative solution to run Jasper reports.

Best regards,
Arno

Offline

Board footer

Powered by FluxBB