int totalWidth = 0;
ColumnsGroupVariable leftmostColumn = findLeftMostColumn(variables);
totalWidth = leftmostColumn.getColumnToApplyOperation().getPosX().intValue();
GlobalGroupColumn globalCol = (GlobalGroupColumn) columnsGroup.getColumnToGroupBy();
JRDesignTextField globalTextField = new JRDesignTextField();
JRDesignExpression globalExp = new JRDesignExpression();
globalExp.setText(globalCol.getTextForExpression());
globalExp.setValueClassName(globalCol.getValueClassNameForExpression());
globalTextField.setExpression(globalExp);
// globalTextField.setHeight(band.getHeight()); //XXX Changed, see if its ok
globalTextField.setHeight(2 + getReport().getOptions().getDetailHeight().intValue()); //XXX be carefull with the "2+ ..."
globalTextField.setWidth(totalWidth);
// globalTextField.setX(((AbstractColumn)getReport().getColumns().get(0)).getPosX().intValue());
globalTextField.setX(0);
if (type.equals(ColumnsGroupVariablesRegistrationManager.HEADER))
globalTextField.setY(yOffset);
globalTextField.setKey("global_legend_"+type);
applyStyleToElement(globalCol.getStyle(), globalTextField);
band.addElement(globalTextField);
}
}
}