Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oracle Jasper Connection #32

Open
mrffiroz opened this issue Jun 19, 2022 · 1 comment
Open

Oracle Jasper Connection #32

mrffiroz opened this issue Jun 19, 2022 · 1 comment

Comments

@mrffiroz
Copy link

$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'
]
];

    I am failed to connect oracle server!!
    Try to us it with laravel 6.8 But always 
    "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 describe how to connect with laravel+oracle 
@mrffiroz
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant