subReport.addExpression(function);
MasterReport report = new MasterReport();
report.setDataFactory(new TableDataFactory(report.getQuery(), new DefaultTableModel(2,2)));
final RelationalGroup rootGroup = (RelationalGroup) report.getRootGroup();
rootGroup.getHeader().addSubReport((SubReport) subReport.derive());
report.getItemBand().addSubReport((SubReport) subReport.derive());
DebugReportRunner.execGraphics2D(report);
}