0

I should like to use an image in a column.

FastReportBuilder drb = new FastReportBuilder();
drb.addImageColumn("Example", expression, 20, true, ImageScaleMode.NO_RESIZE, myStyle);
CustomExpression iexpressionr = new CustomExpression() {

    String ok = "http://....//ok.png";
    String ko = "http://....//error.png";

    public String getClassName() {
        return String.class.getName();
    }

    public Object evaluate(Map fields, Map variables, Map parameters) {
        String result = (String) fields.get("result");
        if (result.equals("true")) {
            return ok;
        } else {
            return ko;
        }
    }
};

My problem is the following: the style of the header is the default. How Can I insert the header style in this case?

I try

ImageColumn d = new ImageColumn();
d.setExpression(imgExpr);
d.setTitle("Example");
d.setWidth(20);        
d.setHeaderStyle(myHeaderStyle);        
d.setStyle(myStyle);

but the method "addColumn" for the object FastReportBuilder it is not good.

Alex K
  • 22,315
  • 19
  • 108
  • 236
  • Did you try to use [DynamicReportBuilder.addColumn(AbstractColumn column)](http://dynamicjasper.com/docs/current/apidocs/ar/com/fdvs/dj/domain/builders/DynamicReportBuilder.html#addColumn%28ar.com.fdvs.dj.domain.entities.columns.AbstractColumn%29) method? – Alex K Feb 08 '14 at 18:11
  • Hi Alex. Ooops, I didn't see that ImageColumn is a subclasse of AbstractColumn – user3284388 Feb 10 '14 at 08:56

0 Answers0