*/
private void registerColumns() {
for (int i = 0; i < cols.length; i++) {
DJCrosstabColumn crosstabColumn = cols[i];
JRDesignCrosstabColumnGroup ctColGroup = new JRDesignCrosstabColumnGroup();
ctColGroup.setName(crosstabColumn.getProperty().getProperty());
ctColGroup.setHeight(crosstabColumn.getHeaderHeight());
JRDesignCrosstabBucket bucket = new JRDesignCrosstabBucket();
JRDesignExpression bucketExp = ExpressionUtils.createExpression("$F{"+crosstabColumn.getProperty().getProperty()+"}", crosstabColumn.getProperty().getValueClassName());
bucket.setExpression(bucketExp);
ctColGroup.setBucket(bucket);
JRDesignCellContents colHeaerContent = new JRDesignCellContents();
JRDesignTextField colTitle = new JRDesignTextField();
JRDesignExpression colTitleExp = new JRDesignExpression();
colTitleExp.setValueClassName(crosstabColumn.getProperty().getValueClassName());
colTitleExp.setText("$V{"+crosstabColumn.getProperty().getProperty()+"}");
colTitle.setExpression(colTitleExp);
colTitle.setWidth(crosstabColumn.getWidth());
colTitle.setHeight(crosstabColumn.getHeaderHeight());
//The height can be the sum of the heights of all the columns starting from the current one, up to the inner most one.
int auxWidth = calculateRowHeaderMaxWidth(crosstabColumn);
colTitle.setWidth(auxWidth);
Style headerstyle = crosstabColumn.getHeaderStyle() == null ? this.djcross.getColumnHeaderStyle(): crosstabColumn.getHeaderStyle();
if (headerstyle != null){
layoutManager.applyStyleToElement(headerstyle,colTitle);
colHeaerContent.setBackcolor(headerstyle.getBackgroundColor());
}
colHeaerContent.addElement(colTitle);
colHeaerContent.setMode(new Byte(Transparency.OPAQUE.getValue()));
applyCellBorder(colHeaerContent);
ctColGroup.setHeader(colHeaerContent);
if (crosstabColumn.isShowTotals())
createColumTotalHeader(ctColGroup,crosstabColumn);