protected void generateHeaderBand(JRDesignBand band) {
        log.debug("Adding column names in header band.");
        band.setHeight(report.getOptions().getHeaderHeight());

        for (AbstractColumn col : getVisibleColumns()) {

            if (col.getTitle() == null)
                continue;

            Style headerStyle = col.getHeaderStyle();
            if (headerStyle == null)
                headerStyle = report.getOptions().getDefaultHeaderStyle();

            this.generateColspanHeader(col, band);

            JRDesignExpression expression = new JRDesignExpression();
            JRDesignTextField textField = new JRDesignTextField();
            expression.setText("\"" + col.getTitle() + "\"");

            //sets header markup (if any)
            if (col.getHeaderMarkup() != null)
                textField.setMarkup(col.getHeaderMarkup().toLowerCase());

            expression.setValueClass(String.class);

            textField.setKey("header_" + col.getTitle());
            textField.setExpression(expression);

            if (col.hasParentCol()) {
                textField.setY(col.getPosY() + band.getHeight() / 2);
                textField.setHeight(band.getHeight() / 2);

            } else {
                textField.setY(col.getPosY());
                textField.setHeight(band.getHeight());
            }

            textField.setX(col.getPosX());
            textField.setWidth(col.getWidth());

            textField.setPrintWhenDetailOverflows(true);
            textField.setBlankWhenNull(true);

            applyStyleToElement(headerStyle, textField);
            band.addElement(textField);
        }
    }
protected void generateHeaderBand ( JRDesignBand band ) { log . debug ( "Adding column names in header band." ) ; band . setHeight ( report . getOptions ( ) . getHeaderHeight ( ) ) ; for ( AbstractColumn col : getVisibleColumns ( ) ) { if ( col . getTitle ( ) == null ) continue ; Style headerStyle = col . getHeaderStyle ( ) ; if ( headerStyle == null ) headerStyle = report . getOptions ( ) . getDefaultHeaderStyle ( ) ; this . generateColspanHeader ( col , band ) ; JRDesignExpression expression = new JRDesignExpression ( ) ; JRDesignTextField textField = new JRDesignTextField ( ) ; expression . setText ( "\"" + col . getTitle ( ) + "\"" ) ; if ( col . getHeaderMarkup ( ) != null ) textField . setMarkup ( col . getHeaderMarkup ( ) . toLowerCase ( ) ) ; expression . setValueClass ( String . class ) ; textField . setKey ( "header_" + col . getTitle ( ) ) ; textField . setExpression ( expression ) ; if ( col . hasParentCol ( ) ) { textField . setY ( col . getPosY ( ) + band . getHeight ( ) / 2 ) ; textField . setHeight ( band . getHeight ( ) / 2 ) ; } else { textField . setY ( col . getPosY ( ) ) ; textField . setHeight ( band . getHeight ( ) ) ; } textField . setX ( col . getPosX ( ) ) ; textField . setWidth ( col . getWidth ( ) ) ; textField . setPrintWhenDetailOverflows ( true ) ; textField . setBlankWhenNull ( true ) ; applyStyleToElement ( headerStyle , textField ) ; band . addElement ( textField ) ; } }
/*
MOVED INSIDE ExpressionUtils
protected JRDesignExpression getExpressionForConditionalStyle(ConditionalStyle condition, AbstractColumn column) {
String text = "(("+CustomExpression.class.getName()+")$P{"+paramName+"})."+CustomExpression.EVAL_METHOD_NAME+"("+textForExpression+")";
String columExpression = column.getTextForExpression();
condition.getCondition().setFieldToEvaluate(exprParams)

PeS17 patch, 2008-11-29: put all fields to fields map, including "invisible" i.e. only registered ones

String fieldsMap = "(("+DJDefaultScriptlet.class.getName() + ")$P{REPORT_SCRIPTLET}).getCurrentFields()";
String parametersMap = "(("+DJDefaultScriptlet.class.getName() + ")$P{REPORT_SCRIPTLET}).getCurrentParams()";
String variablesMap = "(("+DJDefaultScriptlet.class.getName() + ")$P{REPORT_SCRIPTLET}).getCurrentVariables()";

String evalMethodParams =  fieldsMap +", " + variablesMap + ", " + parametersMap + ", " + columExpression;

String text = "(("+ConditionStyleExpression.class.getName()+")$P{"+condition.getName()+"})."+CustomExpression.EVAL_METHOD_NAME+"("+evalMethodParams+")";
JRDesignExpression expression = new JRDesignExpression();
expression.setValueClass(Boolean.class);
expression.setText(text);
return expression;
}