headerBand.addElement(colHeaderField);
// Add fields to the detailBand
if (this.converters.isEmpty()) {
// if no converters are used, create a field depending on the type
JRDesignElement designElement;
if (RenderedImage.class.isAssignableFrom(valueClass)) {
designElement = createImageElement(templateDesign, columnName);
addElement(detailBand, designElement, detailPosX, detailPosY,
columnWidth, detailHeight, columnDetailStyle);
} else {
JRDesignTextField textField = createTextField(columnName);
addElement(detailBand, textField, detailPosX, detailPosY,
columnWidth, detailHeight, columnDetailStyle);
}
} else {
// image element
JRDesignElement imageElement = createImageElement(templateDesign, columnName);
// condition: use this element for images
JRDesignExpression printWhenExpression = new JRDesignExpression();
printWhenExpression.setText("new Boolean($F{" + columnName + "}.getClass().equals(java.awt.image.BufferedImage.class))");
imageElement.setPrintWhenExpression(printWhenExpression);
addElement(detailBand, imageElement, detailPosX, detailPosY,
columnWidth, detailHeight, columnDetailStyle);
// text field element