model.addRow("a", "1", "row-7");
model.addRow("b", "1", "row-8");
model.addRow("b", "2", "row-9");
final SubReport report = new SubReport();
report.addGroup(new RelationalGroup());
report.setDataFactory(new TableDataFactory("query", model));
report.setQuery("query");
report.getStyle().setStyleProperty(ElementStyleKeys.MIN_WIDTH, 200f);
report.getStyle().setStyleProperty(ElementStyleKeys.POS_X, 100f);
report.getStyle().setStyleProperty(ElementStyleKeys.POS_Y, 20f);
final RelationalGroup group0 = (RelationalGroup) report.getGroup(0);
group0.setName("outer-group");
group0.addField("g0");
group0.getHeader().addElement(TableTestUtil.createDataItem("outer-header-field", 100, 20));
group0.getFooter().addElement(TableTestUtil.createDataItem("outer-footer-field", 100, 20));
group0.getStyle().setStyleProperty(ElementStyleKeys.WIDOWS, 2);
final RelationalGroup group1 = (RelationalGroup) report.getGroup(1);
group1.setName("inner-group");
group1.addField("g1");
group1.getHeader().addElement(TableTestUtil.createDataItem("inner-header-field", 100, 20));
group1.getFooter().addElement(TableTestUtil.createDataItem("inner-footer-field", 100, 20));
group1.getStyle().setStyleProperty(ElementStyleKeys.WIDOWS, 2);
report.getItemBand().addElement(TableTestUtil.createDataItem("detail-field", 100, 20));
report.getItemBand().getParentSection().getStyle().setStyleProperty(ElementStyleKeys.WIDOWS, 2);