Package jxl

Examples of jxl.Cell


        for (int i = 0; i < limite.getFilas(); i++) {
            for (int j = 0; j < limite.getColumnas(); j++) {

                Sheet sheet = libroTrabajo.getSheet(this.hojaNombresPuntos);
                //recordar que primero son las columnas y luego filas
                Cell a1 = sheet.getCell(j + 1, i + 1);
                String stringfilas = a1.getContents();
                if (a1.getType() == CellType.EMPTY) {
                    stringfilas = "-";
                }
                reglas[i][j] = stringfilas;
                System.out.print("[" + i + "][" + j + "]= " + stringfilas + "\t");
            }
View Full Code Here


        for (int i = 0; i < limite.getFilas(); i++) {
            for (int j = 0; j < limite.getColumnas(); j++) {

                Sheet sheet = libroTrabajo.getSheet(this.hojaCoordenadasPuntos);
                //recordar que primero son las columnas y luego filas
                Cell a1 = sheet.getCell(j + 1, i + 1);


                String stringfilas = a1.getContents();
                if (a1.getType() == CellType.EMPTY) {
                    stringfilas = "-";
                }
                coordenadas[i][j] = stringfilas;
                System.out.print("[" + i + "][" + j + "]= " + stringfilas + "\t");
            }
View Full Code Here

   * (non-Javadoc)
   * @see net.sourceforge.squirrel_sql.plugins.dataimport.importer.IFileImporter#getInt(int)
   */
  public Integer getInt(int column) throws IOException, UnsupportedFormatException {
    checkPointer();
    Cell cell = sheet.getCell(column, pointer);
    if (cell.getType() != CellType.NUMBER) {
      throw new UnsupportedFormatException();
    }
    return (new Double(((NumberCell) cell).getValue())).intValue();
  }
View Full Code Here

   * (non-Javadoc)
   * @see net.sourceforge.squirrel_sql.plugins.dataimport.importer.IFileImporter#getDate(int)
   */
  public Date getDate(int column) throws IOException, UnsupportedFormatException {
    checkPointer();
    Cell cell = sheet.getCell(column, pointer);
    if (cell.getType() != CellType.DATE) {
      throw new UnsupportedFormatException();
    }
    return ((DateCell) cell).getDate();
  }
View Full Code Here

   * (non-Javadoc)
   * @see net.sourceforge.squirrel_sql.plugins.dataimport.importer.IFileImporter#getLong(int)
   */
  public Long getLong(int column) throws IOException, UnsupportedFormatException {
    checkPointer();
    Cell cell = sheet.getCell(column, pointer);
    if (cell.getType() != CellType.NUMBER) {
      throw new UnsupportedFormatException();
    }
    return (new Double(((NumberCell) cell).getValue())).longValue();
  }
View Full Code Here

          Sheet resultSheet = resultSheets[i];
         
          for(int col = 0; col < sheet.getColumns(); col++){
            for(int row = 0; row < sheet.getRows(); row++){
              try{
                Cell cell = sheet.getCell(col,row);       
       
                String expression = cell.getContents();
  //  System.out.println("ExcelActivity:: onComplete: expression:"+expression);
                if(expression.startsWith("<%=*")){ //if the expression contains any value need to evaluate.
                  String k = expression.substring(4, expression.indexOf("%>"));
  //  System.out.println("ExcelActivity:: key:"+k);
                  Cell resultCell = resultSheet.getCell(col, row);
                  String val = resultCell.getContents();
  //  System.out.println("ExcelActivity:: val:"+val);
                  definition.getProcessVariable(k).set(instance, "", val);
                }else
                if(expression.startsWith("<%->")){ //if the expression contains any value need to evaluate.
                  String k = expression.substring(4, expression.indexOf("%>"));
                  Cell resultCell = resultSheet.getCell(col-1, row);
                  String val = resultCell.getContents();
                  definition.getProcessVariable(k).set(instance, "", val);
                }
              }catch(Exception e){
  //  System.out.println("ExcelActivity:: error in setting value");
                e.printStackTrace();
View Full Code Here

        for (int i = 0; i < limite.getFilas(); i++) {
            for (int j = 0; j < limite.getColumnas(); j++) {

                Sheet sheet = libroTrabajo.getSheet(this.hojaHeuristica);
                //recordar que primero son las columnas y luego filas
                Cell a1 = sheet.getCell(j + 1, i + 1);


                String stringfilas = a1.getContents();
                if (a1.getType() == CellType.EMPTY) {
                    stringfilas = "-";
                }
                reglas[i][j] = stringfilas;
                System.out.print("[" + i + "][" + j + "]= " + stringfilas + "\t");
            }
View Full Code Here

        for (int i = 0; i < limite.getFilas(); i++) {
            for (int j = 0; j < limite.getColumnas(); j++) {

                Sheet sheet = libroTrabajo.getSheet(this.hojaReglas);
                //recordar que primero son las columnas y luego filas
                Cell a1 = sheet.getCell(j + 1, i + 1);
                String stringfilas = a1.getContents();
                if (a1.getType() == CellType.EMPTY) {
                    stringfilas = "-";
                }
                reglas[i][j] = stringfilas;
                System.out.print("[" + i + "][" + j + "]= " + stringfilas + "\t");
            }
View Full Code Here

        int columnas, filas;
        if (elemento == ArchivoExcelBaseConocimiento.REGLAS) {
            System.out.println("Limite reglas");
            Sheet sheet = libroTrabajo.getSheet(this.hojaConfiguraciones);
            //recordar que primero son las columnas y luego filas
            Cell a1 = sheet.getCell(1, 3);
            Cell b2 = sheet.getCell(2, 3);

            String stringfilas = a1.getContents();
            String strincolumnas = b2.getContents();

            columnas = Integer.parseInt(strincolumnas);
            filas = Integer.parseInt(stringfilas);


            System.out.println("filas:      " + stringfilas + "\ncolumnas:   " + strincolumnas);
            return new Limite(filas, columnas);
        } else if (elemento == ArchivoExcelBaseConocimiento.NOMBRESPUNTOS) {
            System.out.println("Limite nombre puntos");
            Sheet sheet = libroTrabajo.getSheet(this.hojaConfiguraciones);
            //recordar que primero son las columnas y luego filas
            Cell a1 = sheet.getCell(1, 2);
            Cell b2 = sheet.getCell(2, 2);

            String stringfilas = a1.getContents();
            String strincolumnas = b2.getContents();

            columnas = Integer.parseInt(strincolumnas);
            filas = Integer.parseInt(stringfilas);


            System.out.println("filas:      " + stringfilas + "\ncolumnas:   " + strincolumnas);
            return new Limite(filas, columnas);
        } else if (elemento == ArchivoExcelBaseConocimiento.HEURISTICA) {
            System.out.println("Limite heuristica");
            Sheet sheet = libroTrabajo.getSheet(this.hojaConfiguraciones);
            //recordar que primero son las columnas y luego filas
            Cell a1 = sheet.getCell(1, 1);
            Cell b2 = sheet.getCell(2, 1);

            String stringfilas = a1.getContents();
            String strincolumnas = b2.getContents();

            columnas = Integer.parseInt(strincolumnas);
            filas = Integer.parseInt(stringfilas);


            System.out.println("filas:      " + stringfilas + "\ncolumnas:   " + strincolumnas);
            return new Limite(filas, columnas);
        } else if (elemento == ArchivoExcelBaseConocimiento.COORDENADASPUNTOS) {
            System.out.println("Limite coordenada puntos");
            Sheet sheet = libroTrabajo.getSheet(this.hojaConfiguraciones);
            //recordar que primero son las columnas y luego filas
            Cell a1 = sheet.getCell(1, 0);
            Cell b2 = sheet.getCell(2, 0);

            String stringfilas = a1.getContents();
            String strincolumnas = b2.getContents();

            columnas = Integer.parseInt(strincolumnas);
            filas = Integer.parseInt(stringfilas);

            System.out.println("filas:      " + stringfilas + "\ncolumnas:   " + strincolumnas);
View Full Code Here

    excelView.render(new HashMap(), request, response);

    Workbook wb = Workbook.getWorkbook(new ByteArrayInputStream(response.getContentAsByteArray()));
    assertEquals("Test Sheet", wb.getSheet(0).getName());
    Sheet sheet = wb.getSheet("Test Sheet");
    Cell cell = sheet.getCell(2, 4);
    assertEquals("Test Value", cell.getContents());
  }
View Full Code Here

TOP

Related Classes of jxl.Cell

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.