Hi There,
Glad to announce, solution found for adding an 'empty' column - and in short, it's to create a customExpression.
def cb = ColumnBuilder.getInstance()
cb = cb.setTitle("Notes")
cb = cb.setCustomExpression(new BlankExpression())
AbstractColumn columnNotes = cb.build()
Then add it to the rest of the report.
Class BlankExpression is
public class BlankExpression implements CustomExpression {
public BlankExpression() { }
public Object evaluate(Map fields, Map variables, Map parameters) {
return " ";
}
public String getClassName() {
return String.class.getName();
}
}
But there are a few issues relating to the use of customExpressions and grails.
1st issue: "getNew()" - The examples provided on the DJ website all use "getNew()"
http://dynamicjasper.sourceforge.net/docs/HOWTO%20Create%20Custom%20Expressions.html is an example of DynamicJasper v3.1.3 where as the Grails plugin is based on v.3.0.6 which only has a getInstance() method (deprecated in 3.1.3)
2nd issue: As far as I can see, groovy doesn't allow java-style inline class implementations, thus forcing us to create a separate class file. But this is not a big problem. I might be wrong about this, and please correct me.
Hope this helps you too.
Regards,
Pete