int counter = 0;
int measureHeight = crosstabRow.getHeight() / djcross.getMeasures().size();
for (Iterator iterator = djcross.getMeasures().iterator(); iterator.hasNext(); counter++) {
DJCrosstabMeasure djmeasure = (DJCrosstabMeasure) iterator.next();
JRDesignTextField element = new JRDesignTextField();
element.setWidth(crosstabColumn.getWidth());
element.setHeight(measureHeight);
element.setY(counter*measureHeight);
JRDesignExpression measureExp = new JRDesignExpression();
// DJCrosstabMeasure measure = djcross.getMeasure(0);
measureExp.setValueClassName(djmeasure.getProperty().getValueClassName());
measureExp.setText("$V{"+djmeasure.getProperty().getProperty()+"}");
element.setExpression(measureExp);
/**
* Is there any style for this object?
*/
if (crosstabRow.getProperty() == null && crosstabColumn.getProperty() == null && djmeasure.getStyle() != null ){
//this is the inner most cell
layoutManager.applyStyleToElement(djmeasure.getStyle() , element);
} else if (crosstabRow.getTotalStyle() != null) {
layoutManager.applyStyleToElement(crosstabRow.getTotalStyle(), element);
}
else if (crosstabColumn.getTotalStyle() != null) {
layoutManager.applyStyleToElement(crosstabColumn.getTotalStyle(), element);
}
if (djmeasure.getLink() != null){
String name = "cell_" + i + "_" + j + "_ope" + djmeasure.getOperation().getValue();
HyperLinkUtil.applyHyperLinkToElement((DynamicJasperDesign)this.design, djmeasure.getLink(), element, name);
}
contents.addElement(element);
}