Examples of RowHandle


Examples of com.extentech.ExtenXLS.RowHandle

        wsh = book.getWorkSheet(0);
        StringBuffer arr = new StringBuffer();
            // return WorkBookCommander.returnXMLErrorResponse("PluginSheet.get() failed: "+ex.toString());
            RowHandle[] rwx = wsh.getRows();
            for (int i=0;i<rwx.length;i++) {
                RowHandle r = rwx[i];
                try{
                  CellHandle[] chx = r.getCells();
                  for(int t=0;t<chx.length;t++){
                    arr.append("'"+chx[t].getFormattedStringVal()+"',");
                  }
                  arr.setLength(arr.length()-1);
                  arr.append("\r\n");
View Full Code Here

Examples of com.extentech.ExtenXLS.RowHandle

          ArrayList hyperlinks= new ArrayList();
          // SHEETxx.XML
         this.writeSheetPrefix(sheet, bk, id);
         RowHandle[] rows = sheet.getRows();
         for(int xd=0;xd<rows.length;xd++){
             RowHandle row = rows[xd];
             try{ // note: row #, col #'s are 1-based, sst and style index are 0-based
                 this.writeRow(row, hyperlinks);
             //} catch (RowNotFoundException re) {
                  ; // do nothing
             }catch (Exception e) {
View Full Code Here

Examples of org.eclipse.birt.report.model.api.RowHandle

  private static TableHandle createSampleTable(String name, int columnNum, int headerRow, int detailRow, int footerRow, boolean border)
      throws SemanticException {
    TableHandle table = reportDesignHandle.getElementFactory().newTableItem(name, columnNum, headerRow, detailRow, footerRow);

    RowHandle myHeader = (RowHandle) table.getHeader().get(0);
    for (int i = 0; i < myHeader.getCells().getCount(); i++) {
      CellHandle cell = (CellHandle) myHeader.getCells().get(i);
      LabelHandle label = createLabel("Column " + i);
      cell.getContent().add(label);
      if (border) {
        setBorders(cell);
      }
    }

    for (int i = 0; i < table.getDetail().getCount(); i++) {
      RowHandle myDetail = (RowHandle) table.getDetail().get(i);
      for (int j = 0; j < myDetail.getCells().getCount(); j++) {
        CellHandle cell = (CellHandle) myDetail.getCells().get(j);
        LabelHandle label = createLabel("Cell " + i + ":" + j);
        cell.getContent().add(label);
        if (border) {
          setBorders(cell);
        }
View Full Code Here

Examples of org.eclipse.birt.report.model.api.RowHandle

  }

  private static GridHandle createSampleGrid(String name, int columnNum, int rowNum, boolean border) throws SemanticException {
    GridHandle grid = createGrid(name, columnNum, rowNum);

    RowHandle headerRow = (RowHandle) grid.getRows().get(0);

    for (int i = 0; i < headerRow.getCells().getCount(); i++) {
      CellHandle cell = (CellHandle) headerRow.getCells().get(i);
      if (border) {
        setBorders(cell);
      }
      LabelHandle label = createLabel("Column " + i);
      cell.getContent().add(label);
    }

    RowHandle detailRow = null;
    for (int i = 0; i < rowNum; i++) {
      detailRow = createRow(columnNum);
      for (int j = 0; j < grid.getColumnCount(); j++) {
        CellHandle cell = (CellHandle) detailRow.getCells().get(j);
        if (border) {
          setBorders(cell);
        }
        LabelHandle label = createLabel("Cell " + i + ":" + j);
        cell.getContent().add(label);
      }
      grid.getElement().add(detailRow.getElement(), GridItem.ROW_SLOT);
    }

    return grid;
  }
View Full Code Here

Examples of org.eclipse.birt.report.model.api.RowHandle

    return label;
  }

  public static void addGridRow(GridHandle grid, boolean border) throws SemanticException {
    int columnNum = grid.getColumnCount();
    RowHandle row = reportDesignHandle.getElementFactory().newTableRow(columnNum);

    if (border) {
      for (int i = 0; i < columnNum; i++) {
        CellHandle cell = (CellHandle) row.getCells().get(i);
        setBorders(cell);
      }
    }

    DesignElement deRow = row.getElement();
    grid.getElement().add(deRow, GridItem.ROW_SLOT);
  }
View Full Code Here

Examples of org.eclipse.birt.report.model.api.RowHandle

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

Examples of org.eclipse.birt.report.model.api.RowHandle

    int rowCount = gridHandle.getRows().getCount(); // = 1
    System.out.println("rowCount = " + rowCount);
    int colCount = gridHandle.getColumns().getCount(); // = 1
    // System.out.println("colCount = " + colCount);
    // ############# create row
    RowHandle row = reportDesignHandle.getElementFactory().newTableRow();
    DesignElement deRow = row.getElement();
    gridHandle.getElement().add(deRow, GridItem.ROW_SLOT);

    int rowCount2 = gridHandle.getRows().getCount(); // = 2
    System.out.println("rowCount2 = " + rowCount2);
    int colCount2 = gridHandle.getColumns().getCount(); // = 1
View Full Code Here

Examples of org.eclipse.birt.report.model.api.RowHandle

      // Add the grid to the report body
      design.getBody().add(grid);

      // create a new row
      RowHandle row = (RowHandle) grid.getRows().get(0);

      // Create a label and add it to the first cell.
      LabelHandle label = efactory.newLabel("Hello, world!");
      label.setText("Hello, World!");
      CellHandle cell = (CellHandle) row.getCells().get(0);
      cell.getContent().add(label);

      // save the report design
      design.saveAs("c:/TEMP/sample.rptdesign");
      design.close();
View Full Code Here

Examples of org.eclipse.birt.report.model.api.RowHandle

                columnList.size());
        reportTable.setWidth("100%");
        reportTable.setDataSet(dataSetHandleToUse);

        // create a new detail row and add to the report
        RowHandle detailRow = (RowHandle) reportTable.getDetail()
            .get(0);
        int x = 0; // used to mark current column position

        // go through column list and create a new column binding,
        // otherwise data will not be populated into the report
        // Then add a new column to our row
        for (Iterator i = columnList.iterator(); i.hasNext();) {
          String columnName = (String) i.next();

          ComputedColumn computedColumn = StructureFactory
              .createComputedColumn();
          computedColumn.setName(columnName);
          computedColumn.setExpression("dataSetRow[\"" + columnName
              + "\"]");
          PropertyHandle computedSet = reportTable
              .getColumnBindings();
          reportTable.getColumnBindings().addItem(computedColumn);

          // add new data item and cell
          DataItemHandle data = reportDesign.getElementFactory()
              .newDataItem(columnName);
          data.setResultSetColumn(columnName);
          CellHandle cell = (CellHandle) detailRow.getCells().get(x);
          cell.getContent().add(data);
          x++; // advance position
        }

        // add the table to my report
View Full Code Here

Examples of org.eclipse.birt.report.model.api.RowHandle

        cs1.setExpression("dataSetRow[\"" + (String) cols.get(i) + "\"]");
        computedSet.addItem(cs1);
      }

      // table header
      RowHandle tableheader = (RowHandle) table.getHeader().get(0);

      for( int i = 0 ; i < cols.size() ; i++ ) {
        LabelHandle label1 = designFactory.newLabel((String) cols.get(i));
        label1.setText((String) cols.get(i));
        CellHandle cell = (CellHandle) tableheader.getCells().get(i);
        cell.getContent().add(label1);
      }

      // table detail
      RowHandle tabledetail = (RowHandle) table.getDetail().get(0);

      for( int i = 0 ; i < cols.size() ; i++ ) {
        CellHandle cell = (CellHandle) tabledetail.getCells().get(i);
        DataItemHandle data = designFactory.newDataItem("data_" + (String) cols.get(i));
        data.setResultSetColumn((String) cols.get(i));
        cell.getContent().add(data);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.