/* Add a "Layout" grid to the page */
Grid grid = new Grid();
grid.setCellPadding(5);
report.getWebPage().addChildElement(grid);
GridRow row1 = new GridRow();
GridRow row2 = new GridRow();
GridRow row3 = new GridRow();
GridRow row4 = new GridRow();
grid.addRows(row1,row2,row3,row4);
row1.addCell(new GridCell(new RawHTML("<h2>Top 5 Pets</h2>")));
row1.addCell(new GridCell(new RawHTML("<h2>Vote Summary</h2>")));
row3.addCell(new GridCell(new RawHTML("<h2>Pet Locations</h2>")));
row3.addCell(new GridCell(new RawHTML("<h2>Score Summary</h2>")));
/* create data table, set the data query */
DataTable table = new DataTable();
table.setCellPadding(1);
table.setDataQuery(queryB);
queryB.getFilters().add(new TopNFilter(5, col5b));
/* create table header rows */
GridRow tableHeader = new GridRow();
tableHeader.addCell(new com.googlecode.g2re.html.GridCell(new RawHTML("Name")));
tableHeader.addCell(new com.googlecode.g2re.html.GridCell(new RawHTML("Description")));
tableHeader.addCell(new com.googlecode.g2re.html.GridCell(new RawHTML("Price")));
table.getHeaderRows().add(tableHeader);
/* create table body rows */
GridRow tableBody = new GridRow();
tableBody.addCell(new com.googlecode.g2re.html.GridCell(new DataElement(col1b, 0)));
tableBody.addCell(new com.googlecode.g2re.html.GridCell(new DataElement(col2b, 1)));
/* add formatted price column */
DataElement priceCellElement = new DataElement(col3b, 2);
priceCellElement.setNumberFormat("$###,###,###,##0.00");
tableBody.addCell(new com.googlecode.g2re.html.GridCell(priceCellElement));
/* add rows to table */
table.getBodyRows().add(tableBody);
/* add the table to the report */