final ResourceManager mgr = new ResourceManager();
final MasterReport report = (MasterReport) mgr.createDirectly(url, MasterReport.class).getResource();
report.getReportConfiguration().setConfigProperty
("org.pentaho.reporting.engine.classic.core.FailOnAttributeExpressionErrors", "true");
final FormulaExpression function = new FormulaExpression();
function.setName("Test");
function.setFormula("=SINGLEVALUEQUERY(\"Good\")");
report.getReportHeader().setAttributeExpression
(AttributeNames.Core.NAMESPACE, AttributeNames.Core.NAME, function);
try