for (int i = 0; i < 1000; i += 1)
{
model.addRow(new Object[]{"K1", Integer.valueOf(1)});
}
final PageItemSumFunction itemSumFunction = new PageItemSumFunction();
itemSumFunction.setField("value");
itemSumFunction.setName("fn");
final MasterReport report = new MasterReport();
report.setQuery("test");
report.setDataFactory(new TableDataFactory(report.getQuery(), model));
report.addExpression(itemSumFunction);