phpjasper
phpjasper copied to clipboard
MSSql Connection not working
Describe the bug When trying to use your library I getted debug messages, I can't to use it and there is no documented. After a lot of testing we (me and my team) get to the solution that on MSSQL
The messages are: Error filling reportUnable to get next record from result set. Error filling reportError executing SQL statement for:
To Reproduce I use the example mssql connection and the output was:
$options = [
'format' => ['pdf'],
'params' => [
'WHERE' => $id,
'SUBREPORT_DIR' => $base_path.'/app/reports/subreports/'
],
'db_connection' => [
'driver' => 'generic',
'host' => 'XXXXXX',
'port' => '1433',
'database' => 'XXXXX',
'username' => 'XXXXX',
'password' => 'XXXXX',
'jdbc_dir' => $jdbc_dir,
'jdbc_driver' => 'com.microsoft.sqlserver.jdbc.SQLServerDriver',
'jdbc_url' => '"jdbc:sqlserver://XXXXXX:1433;databaseName=XXXXX"',
]
];
jasperstarter process "/Applications/MAMP/htdocs/caepia-app/app/reports/transfer.jrxml" -o "/Applications/MAMP/htdocs/XXX/app/reports/generated/transfer/139" -f pdf -P WHERE="139" -t generic -H XXXXX --db-port 1433 -n XXXXX -u XXXXX -p XXXXX --jdbc-dir /Applications/MAMP/htdocs/XXX/src/JasperStarter/jdbc/ --db-driver com.microsoft.sqlserver.jdbc.SQLServerDriver --db-url jdbc:sqlserver://XXXXXX:1433;databaseName=XXXXX
Where XXXXXX are the correct parameters.
To Solve
We solved putting "" your jdbc_url as
'jdbc_url' => '"jdbc:sqlserver://XXXXXXXX:1433;databaseName=XXXXX"',
Please put that on your docs to future users as possible solution.
Thanks @adriacobo
Thanks @adriacobo
Thanks....took 3-4 days to solve this problem