我想使用 vertx 和 JasperReports,创建连接并对其进行测试,一切正常,但是当我想使用 fillReport 方法(最后一个是连接)填充 jasper 报告时,它显示错误:
JasperFillManager 类型中的方法 fillReport(JasperReport, Map< String,Object >, Connection) 不适用于参数(JasperReport, null, Class < connection>)。
知道我应该如何将我的 SQLConnect 转换为连接吗?
这是我的代码:
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);}
问候。