f.setExpression(uc.formulaString());
// If a formula contains a user column and the user column isn't used
// in any report field (but the formula is), prove that the query will
// contain the user column.
Query q = (Query)report.getDataSource().getQuery();
q.findSelectablesUsed();
assertTrue("user col contained in formula isn't in query",
q.indexOfSelectable(uc) >= 0);
// Now make the formula's expression a Ruby expression that "hides" a
// column that isn't otherwise in the report. By "hide" I mean that a
// simple search for "{" won't work; the formula will have to use its
// "exceptAfter" ivar to ignore the "#{" Ruby expession start.
f.setExpression("#{{aggregate_test.col1}}");
Column col = report.findColumn("aggregate_test.col1");
assertNotNull(col);
q.findSelectablesUsed();
assertTrue("col contained in Ruby string expression isn't in query",
q.indexOfSelectable(col) >= 0);
}