model.addRow("b", "3", "row-11");
model.addRow("a", "1", "row-12");
model.addRow("b", "1", "row-13");
model.addRow("b", "2", "row-14");
final SubReport report = new SubReport();
report.getStyle().setStyleProperty(ElementStyleKeys.MIN_WIDTH, 200f);
report.getStyle().setStyleProperty(ElementStyleKeys.POS_X, 100f);
report.getStyle().setStyleProperty(ElementStyleKeys.POS_Y, 20f);
report.addGroup(new RelationalGroup());
report.setDataFactory(new TableDataFactory("query", model));
report.setQuery("query");
final RelationalGroup group0 = (RelationalGroup) report.getGroup(0);
group0.setName("outer-group");
group0.addField("g0");
group0.getHeader().addElement(createDataItem("outer-header-field", 100, 20));
group0.getFooter().addElement(createDataItem("outer-footer-field", 100, 20));
group0.getStyle().setStyleProperty(ElementStyleKeys.ORPHANS, 2);
final RelationalGroup group1 = (RelationalGroup) report.getGroup(1);
group1.setName("inner-group");
group1.addField("g1");
group1.getHeader().addElement(createDataItem("inner-header-field", 100, 20));
group1.getFooter().addElement(createDataItem("inner-footer-field", 100, 20));
report.getItemBand().addElement(createFieldItem("detail-field", 100, 20));
report.getItemBand().getParentSection().getStyle().setStyleProperty(ElementStyleKeys.ORPHANS, 200);
group1.getStyle().setStyleProperty(ElementStyleKeys.ORPHANS, 2);
final MasterReport master = new MasterReport();
master.setPageDefinition(new SimplePageDefinition(new PageSize(500, 100)));
master.getReportHeader().addElement(report);