Package org.eclipse.birt.report.model.api

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


    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


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

  private static CellHandle createCell() {
    return reportDesignHandle.getElementFactory().newCell();
  }

  private static LabelHandle createLabel(String text) throws SemanticException {
    LabelHandle label = elementFactory.newLabel(null);
    label.setText(text);
    return label;
  }
View Full Code Here

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

    System.out.println("rowCount2 = " + rowCount2);
    int colCount2 = gridHandle.getColumns().getCount(); // = 1
    // System.out.println("colCount2 = " + colCount2);

    // create label for cell in row 1 / column 0
    LabelHandle lblHandle = elementFactory.newLabel(null);
    lblHandle.setText("Cell x:x");
    CellHandle cell = gridHandle.getCell(1, 0);
    cell.getContent().add(lblHandle);

    // ############# create column
    ColumnHandle column = reportDesignHandle.getElementFactory().newTableColumn();
    DesignElement deColumn = column.getElement();
    gridHandle.getElement().add(deColumn, GridItem.COLUMN_SLOT);

    int rowCount3 = gridHandle.getRows().getCount(); // = 2
    int colCount3 = gridHandle.getColumns().getCount(); // = 2

    // create label for cell in row 0 / column 1
    LabelHandle lblHandle2 = elementFactory.newLabel(null);
    lblHandle.setText("Cell y:y");
    // this.setStyle(lblHandle2, "borderSolidThin");
    CellHandle cell2 = gridHandle.getCell(0, 1);
    cell2.getContent().add(lblHandle2);
    System.out.println("Finished");
View Full Code Here

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

      // 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
View Full Code Here

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

    CellHandle tcell = (CellHandle) header.getCells().get(0);
    tcell.getWidth().setStringValue("3in");
    LabelHandle label = elementFactory.newLabel(null);
    label.setText("Order");//$NON-NLS-1$
    tcell.getContent().add(label);

    tcell = (CellHandle) header.getCells().get(1);
    label = elementFactory.newLabel(null);
    label.setText("Product");//$NON-NLS-1$
    tcell.getContent().add(label);

    tcell = (CellHandle) header.getCells().get(2);
    label = elementFactory.newLabel(null);
    label.setText("Amount");//$NON-NLS-1$
    tcell.getContent().add(label);

    // Table Group
    TableGroupHandle group = elementFactory.newTableGroup();
    group.setName("MyGroup");
View Full Code Here

TOP

Related Classes of org.eclipse.birt.report.model.api.LabelHandle

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.