final ReportObjectivesFilter filter = form.getFilter();
if (filter.getFromDate() == null) {
return;
}
log.info("load report: " + filter);
final ReportStorage storage = getReportStorage();
final Report report = storage.getRoot();
final String currentReportId = storage.getCurrentReport().getId(); // Store current report id.
final DateHolder day = new DateHolder(filter.getFromDate());
report.setFrom(day.getYear(), day.getMonth());
if (filter.getToDate() != null) {
day.setDate(filter.getToDate());
} else {
day.setEndOfMonth();
}
report.setTo(day.getYear(), day.getMonth());
reportDao.loadReport(report);
storage.setCurrentReport(currentReportId); // Select previous current report.
}