dataSetHandle.setFetch("if ( i < " + rows + "){" + "row[\"Month\"] = (i + 1);" + "row[\"Product\"] = 'Product ' + i;" + "i++;"
+ "return true;" + "} else return false;");
// Set computed columns
ComputedColumn cs1 = StructureFactory.createComputedColumn();
cs1.setName("Month");
cs1.setExpression("row[\"Month\"]");
cs1.setDataType("integer");
ComputedColumn cs2 = StructureFactory.createComputedColumn();
cs2.setName("Product");
cs2.setExpression("row[\"Product\"]");
cs2.setDataType("string");
ComputedColumn cs3 = StructureFactory.createComputedColumn();
cs3.setName("Amount");
cs3.setExpression("row[\"Amount\"]");
cs3.setDataType("integer");
PropertyHandle computedSet = dataSetHandle.getPropertyHandle("computedColumns");
computedSet.addItem(cs1);
computedSet.addItem(cs2);
computedSet.addItem(cs3);
reportDesignHandle.getDataSets().add(dataSetHandle);
TableHandle mytable = elementFactory.newTableItem(null, 3, 1, 1, 1);
mytable.setWidth("100%");
mytable.setProperty("dataSet", dataSet);
computedSet = mytable.getColumnBindings();
cs1.setExpression("dataSetRow[\"Month\"]");
computedSet.addItem(cs1);
cs2.setExpression("dataSetRow[\"Product\"]");
computedSet.addItem(cs2);
cs3.setExpression("dataSetRow[\"Amount\"]");
computedSet.addItem(cs3);
// Header
RowHandle myheader = (RowHandle) mytable.getHeader().get(0);