/* add params to report */
report.getReportParameters().add(minParam);
report.getReportParameters().add(maxParam);
/* Create a jdbc sql query and add to the report */
JdbcQuery queryA = new JdbcQuery();
queryA.setDataConnection(conn);
queryA.setName("TotalQuery");
queryA.setSqlQuery(totalQuery);
DataColumn col1a = new DataColumn("Name", 0, DataType.STRING);
DataColumn col2a = new DataColumn("Scores", 1, DataType.INTEGER);
DataColumn col3a = new DataColumn("Votes", 2, DataType.INTEGER);
queryA.getColumns().add(col1a);
queryA.getColumns().add(col2a);
queryA.getColumns().add(col3a);
queryA.getParameters().add(new JdbcParameter(1, DataType.INTEGER, minParam));
queryA.getParameters().add(new JdbcParameter(2, DataType.INTEGER, maxParam));
report.getDataQueries().add(queryA);
/* Create a jdbc sql query and add to the report */
JdbcQuery queryB = new JdbcQuery();
queryB.setDataConnection(conn);
queryB.setName("ListQuery");
queryB.setSqlQuery(petQuery);
DataColumn col1b = new DataColumn("Name", 0, DataType.STRING);
DataColumn col2b = new DataColumn("Description", 1, DataType.INTEGER);
DataColumn col3b = new DataColumn("Price", 2, DataType.DOUBLE);
DataColumn col4b = new DataColumn("Zip", 3, DataType.STRING);
DataColumn col5b = new DataColumn("Votes", 4, DataType.INTEGER);
queryB.getColumns().add(col1b);
queryB.getColumns().add(col2b);
queryB.getColumns().add(col3b);
queryB.getColumns().add(col4b);
queryB.getColumns().add(col5b);
queryB.getParameters().add(new JdbcParameter(1, DataType.INTEGER, minParam));
queryB.getParameters().add(new JdbcParameter(2, DataType.INTEGER, maxParam));
report.getDataQueries().add(queryB);
/* 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")));