ReportLocal reportLocal = reportHome.findByPrimaryKey(new ReportPK(reportId, this.dataSource));
reportResult.setReportId(reportLocal.getReportId());
reportResult.setModuleId(reportLocal.getModuleId());
reportResult.setName(reportLocal.getName());
reportResult.setSearchCriteria(getSearchCriteriaString(userId, reportId));
Date dateFrom = reportLocal.getDateFrom();
Date dateTo = reportLocal.getDateTo();
try {
String query = getQueryForResultReport(userId, reportId, search, dataAccessLayer);
dataAccessLayer.setSqlQuery(query);
resultSet = dataAccessLayer.executeQueryNonParsed();
ResultSetMetaData metaData = resultSet.getMetaData();
int cols = metaData.getColumnCount();
int i = 0;
boolean exclude = false;
boolean[] isDate = new boolean[cols + 1];
for (i = 1; i <= cols; i++) {
isDate[i] = false;
}
for (i = 1; i <= cols; i++) {
if ((Types.DATE == metaData.getColumnType(i) || Types.TIMESTAMP == metaData.getColumnType(i))
&& !metaData.getColumnName(i).equalsIgnoreCase("Modified") && !metaData.getColumnName(i).equalsIgnoreCase("Created")) {
isDate[i] = true;
}
} // end for ( i = 1; i <= cols; i++)
while (resultSet.next()) {
resultLine = new ArrayList();
exclude = false;
for (i = 1; i <= cols; i++) {
if (isDate[i]) {
Date dateField = resultSet.getDate(i);
if (dateField != null) {
if (dateFrom != null && dateFrom.after(dateField)) {
exclude = true;
}
if (dateTo != null && dateTo.before(dateField)) {