Open mrffiroz opened 2 years ago
public function daily_Collection_report_5(Request $request){ $jasper = new PHPJasper;
$inputs = __DIR__ . '/../../../../vendor/geekcom/phpjasper/examples/Blank_A4.jrxml';
$input = __DIR__ . '/../../../../vendor/geekcom/phpjasper/examples/Blank_A4.jasper';
$output = __DIR__ .'/../../../../vendor/geekcom/phpjasper/examples';
$jdbc_dir = __DIR__ . '/../../../../vendor/geekcom/phpjasper/bin/jaspertarter/jdbc';
$options = [
'format' => ['pdf'],
'locale' => 'en',
'params' => ['bankId'=>'260','stDate'=>'06/10/2021','edDate'=>'06/19/2021','branchId'=>''],
'db_connection' => [
'driver' => 'generic',
'username' => 'BANK',
'password' => 'BANK',
'host' => '192.168.78.1',
'database' => "dummydb",
'port' => '1521',
'jdbc_dir' => $jdbc_dir,
'jdbc_driver'=>'oracle.jdbc.driver.OracleDriver',
'jdbc_url' => 'jdbc:oracle:thin:@192.168.78.1:1521:dummydb',
'db_sid' => 'dummydb'
]
];
$jasper->compile($inputs,$output,
$options)->execute();
$jasper->process(
$input,
$output,
$options
)->execute();
$file_location = __DIR__ . '/../../../../vendor/geekcom/phpjasper/examples/Blank_A4.pdf';
return response()->file($file_location);
}
This is my laravel controller action
$input = DIR . '/../../../../vendor/geekcom/phpjasper/examples/Blank_A4.jasper'; $output = DIR .'/../../../../vendor/geekcom/phpjasper/examples'; $jdbc_dir = DIR . '/../../../../vendor/geekcom/phpjasper/bin/jaspertarter/jdbc'; $options = [ 'format' => ['pdf'], 'locale' => 'en', //'params' => ['bankId'=>'260','stDate'=>'06/10/2021','edDate'=>'06/19/2021','branchId'=>''], 'db_connection' => [ 'driver' => 'generic', 'username' => 'BANK', 'password' => 'BANK', 'host' => '192.168.78.1', 'database' => "dummydb", 'port' => '1521', 'jdbc_dir' => $jdbc_dir, 'jdbc_driver'=>'oracle.jdbc.driver.OracleDriver', 'jdbc_url' => 'jdbc:oracle:thin:@192.168.78.1:1521:dummydb', 'db_sid' => 'dummydb' ] ];