Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

SanjoyDas's avatar

Jasper Report Error in Postgre

My code is $jasper = new JasperPHP; // $input = DIR . '/Report/Coffee.jrxml'; // $output = DIR . '/Report'; // $options = ['format' => ['pdf']];

    // Compile a JRXML to Jasper
    $t=  $jasper->compile( base_path('/vendor/cossou/jasperphp/examples/hello_world.jrxml'))->execute();

    




    $output = base_path('/public/download');

    
    

    $jdbc_dir = 'D:\xampp8\htdocs\du\vendor\cossou\jasperphp\src\JasperStarter\jdbc';

    // Process a Jasper file to PDF and RTF (you can use directly the .jrxml)
    $jasper->process(
        base_path('/vendor/cossou/jasperphp/examples/hello_world.jrxml'),
        $output,
        array("pdf",'csv'),
        array("php_version" => "8.1.6"),
        array(
	      'driver' => 'pgsql',
	      'username' => env('username'),
	      'password' =>env('password'),
	      'host' => env('db_host'),
	      'database' =>env('db_name'),
	      'port' => '5432',
	       'jdbc_driver' => 'org.postgresql.Driver',
        'jdbc_url' => 'jdbc:postgresql://'.env('db_host').':5432/'.env('db_name'),
        'jdbc_dir' => $jdbc_dir

	    )

    )->execute();

   
   
    echo "Report Generated";

Giving Error :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.

0 likes
1 reply
ThantsinKS's avatar

hello i just want to ask one question that how can i add language such as japanese fonts

Please or to participate in this conversation.