// if relationshipName is null then use fieldName but remove trailing "Id"
fieldName =
Utils.isNotEmpty(field.getRelationshipName()) ? field.getRelationshipName() : fieldName
.substring(0, fieldName.length() - 2);
}
ReportTypeColumn column = new ReportTypeColumn();
column.setCheckedByDefault(false);
column.setField(fieldName);
column.setTable(tableName);
section.getColumns().add(column);
}
reportType.getSections().clear(); // spring bean, reportTypeMetadata is singleton; therefore, content from
// previous session won't be clean-up.
reportType.getSections().add(section);