I want to use vertx and JasperReports, I create my connection and I test it, everything is ok, but when I want to fill jasper report by using fillReport method (where the last one is Connection) it shows error :
The method fillReport(JasperReport, Map< String,Object >, Connection) in the type JasperFillManager is not applicable for the arguments (JasperReport, null, Class < connection>).
Any idea how should I cast my SQLConnect to connect ?
Here is my code :
AsyncSQLClient client = MySQLClient.createShared(vertx, mySQLClientConfig);
client.getConnection(res -> {
if (res.succeeded()) {
SQLConnection connection = res.result();
try{
String report = "C:\\Users\\paths\\Test1.jrxml";
JasperReport Jasp = JasperCompileManager.compileReport(report);
JasperPrint JASP_PRINT = JasperFillManager.fillReport(Jasp, null, connection);
JasperViewer.viewReport(JASP_PRINT);
}
catch(Exception ex){System.out.println(ex);}
Regards.