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);
CellHandle tcell = (CellHandle) myheader.getCells().get(0);
setBorders(tcell);
LabelHandle mylabel = elementFactory.newLabel(null);
mylabel.setText("Col1");
tcell.getContent().add(mylabel);
tcell = (CellHandle) myheader.getCells().get(1);
setBorders(tcell);
// tcell.setProperty(propName, value);
mylabel = elementFactory.newLabel(null);
mylabel.setText("Col2");
tcell.getContent().add(mylabel);
tcell = (CellHandle) myheader.getCells().get(2);
setBorders(tcell);
mylabel = elementFactory.newLabel(null);
mylabel.setText("Col3");
tcell.getContent().add(mylabel);
RowHandle mydetail = (RowHandle) mytable.getDetail().get(0);
tcell = (CellHandle) mydetail.getCells().get(0);
setBorders(tcell);
DataItemHandle mydata = elementFactory.newDataItem(null);
mydata.setResultSetColumn("Month");
tcell.getContent().add(mydata);
tcell = (CellHandle) mydetail.getCells().get(1);
mydata = elementFactory.newDataItem(null);
mydata.setResultSetColumn("Product");
tcell.getContent().add(mydata);
CellHandle lastCell = (CellHandle) mydetail.getCells().get(2);
lastCell.drop();
tcell.setColumnSpan(2);
setBorders(tcell);
mytable.getColumns().get(0).setProperty("width", "45%");
mytable.getColumns().get(1).setProperty("width", "45%");
mytable.getColumns().get(2).setProperty("width", "10%");
return mytable;
}