report.setDataSource(dataSource);
}
if (report.getReportChart() != null)
{
ReportChart chart = chartProvider.getReportChart(report.getReportChart().getName());
if (chart == null)
{
if (report.getReportChart().getDataSource() != null)
{
ReportDataSource dataSource = dataSourceProvider.getDataSource(report.getReportChart().getDataSource().getName());
if (dataSource == null)
{
dataSource = dataSourceProvider.insertDataSource(report.getReportChart().getDataSource());
log.info("Adding DataSource: " + dataSource.getName());
}
report.getReportChart().setDataSource(dataSource);
}
if (report.getReportChart().getDrillDownReport() != null)
{
Report drillDownReport = reportProvider.getReport(report.getReportChart().getDrillDownReport().getName());
if (drillDownReport == null)
{
drillDownReport = reportProvider.insertReport(report.getReportChart().getDrillDownReport());
log.info("Adding Report: " + drillDownReport.getName());
}
report.getReportChart().setDrillDownReport(drillDownReport);
}
if (report.getReportChart().getOverlayChart() != null)
{
ReportChart overlayChart = chartProvider.getReportChart(report.getReportChart().getOverlayChart().getName());
if (overlayChart == null)
{
overlayChart = chartProvider.insertReportChart(report.getReportChart().getOverlayChart());
log.info("Adding Chart: " + overlayChart.getName());
}
report.getReportChart().setOverlayChart(overlayChart);
}
chart = chartProvider.insertReportChart(report.getReportChart());