String str = getExpression();
if (str == null || str.trim().length() == 0)
return null;
// Special values
str = StringUtils.replaceDelimited("#", "{%", "}", new Replacer() {
public Object replace(String str) {
Object obj = SpecialField.value(formulaField, str, report);
return obj == null ? "nil" : obj;
}},
str);
if (str == null) return null;
// Formula values
str = StringUtils.replaceDelimited("#", "{@", "}", new Replacer() {
public Object replace(String str) {
Formula f = report.findFormula(str);
return f == null ? "nil" : f.eval(formulaField);
}},
str);
if (str == null) return null;
// Parameter values
str = StringUtils.replaceDelimited("#", "{?", "}", new Replacer() {
public Object replace(String str) {
Parameter p = report.findParameter(str);
return p == null ? "nil" : p.getValue();
}},
str);
if (str == null) return null;
// User column values
str = StringUtils.replaceDelimited("#", "{!", "}", new Replacer() {
public Object replace(String str) {
UserColumn uc = report.findUserColumn(str);
return uc == null ? "nil" : report.columnValue(uc);
}},
str);
if (str == null) return null;
// Column values
str = StringUtils.replaceDelimited("#", "{", "}", new Replacer() {
public Object replace(String str) {
Column col = report.findColumn(str);
if (col == null)
return "{" + str + "}";