if (datasourceName != null && datasourceName.length() > 0) {
Debug.logInfo("Filling report with connection from datasource: " + datasourceName, module);
jp = JasperFillManager.fillReport(report, parameters, ConnectionFactory.getConnection(datasourceName));
} else {
Debug.logInfo("Filling report with an empty JR datasource", module);
jp = JasperFillManager.fillReport(report, parameters, new JREmptyDataSource());
}
} else {
Debug.logInfo("Filling report with a passed in jrDataSource", module);
jp = JasperFillManager.fillReport(report, parameters, jrDataSource);
}