Package com.googlecode.g2re.domain

Examples of com.googlecode.g2re.domain.JdbcQuery


                .append("WHERE item.address_addressid = address.addressid ")
                .append("AND item.productid = product.productid ")
                .append("AND price between ? and ?").toString();
       
        /* Create a jdbc sql query and add to the report */
        JdbcQuery queryA = new JdbcQuery();
        queryA.setDataConnection(conn);
        queryA.setName("PetLocationQuery");
        queryA.setSqlQuery(sqlA);
        DataColumn col1 = new DataColumn("Name", 0, DataType.STRING);
        DataColumn col2 = new DataColumn("Description", 1, DataType.STRING);
        DataColumn col3 = new DataColumn("Category", 2, DataType.STRING);
        DataColumn col4 = new DataColumn("Price", 3, DataType.DOUBLE);
        DataColumn col5 = new DataColumn("Image", 4, DataType.STRING);
        DataColumn col6 = new DataColumn("City", 5, DataType.STRING);
        DataColumn col7 = new DataColumn("State", 6, DataType.STRING);
        DataColumn col8 = new DataColumn("Zip", 7, DataType.STRING);
        queryA.getColumns().add(col1);
        queryA.getColumns().add(col2);
        queryA.getColumns().add(col3);
        queryA.getColumns().add(col4);
        queryA.getColumns().add(col5);
        queryA.getColumns().add(col6);
        queryA.getColumns().add(col7);
        queryA.getColumns().add(col8);
        queryA.getParameters().add(new JdbcParameter(1, DataType.INTEGER, minParam));
        queryA.getParameters().add(new JdbcParameter(2, DataType.INTEGER, maxParam));
        report.getDataQueries().add(queryA);
       
       
        /* create data table, set the data query */
        DataTable table = new DataTable();
View Full Code Here


        /* 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")));
View Full Code Here

TOP

Related Classes of com.googlecode.g2re.domain.JdbcQuery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.