//PropertyColumn only can be used for grouping (not OperationColumn)
protected Object transformEntity(Entity entity) {
log.debug("transforming group...");
ColumnsGroup columnsGroup = (ColumnsGroup) entity;
PropertyColumn column = columnsGroup.getColumnToGroupBy();
JRDesignGroup group = new JRDesignGroup();
int groupIndex = getDynamicReport().getColumnsGroups().indexOf(columnsGroup);
int columnIndex = getDynamicReport().getColumns().indexOf(columnsGroup.getColumnToGroupBy());
if (column instanceof GlobalGroupColumn){
group.setName("global_column_" + groupIndex);
} else {
group.setName( "group["+groupIndex+"]_for_column_" + columnIndex + "-" + column.getTitle());
}
group.setCountVariable(new JRDesignVariable());
group.setGroupFooter(new JRDesignBand());
group.setGroupHeader(new JRDesignBand());
JRDesignExpression jrExpression = new JRDesignExpression();
jrExpression.setText(column.getTextForExpression());
jrExpression.setValueClassName(column.getValueClassNameForExpression());
group.setExpression(jrExpression);
group.setCountVariable(new JRDesignVariable());
return group;
}