Examples of XSSFCellStyle


Examples of org.apache.poi.xssf.usermodel.XSSFCellStyle

            // FILL SHEET
            int rowNum = endCell.getRow();
           
            int cellType = -1;
            XSSFCellStyle cellStyle = null;

            for( XmlObject value : bindValues ) {

                XSSFRow row = sheet.getRow(rowNum);
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.XSSFCellStyle

        CTCol col_2 = ctWorksheet.getColsArray(0).addNewCol();
        col_2.setMin(10);
        col_2.setMax(12);
        col_2.setStyle(1);
        assertEquals(1, columnHelper.getColDefaultStyle(11));
        XSSFCellStyle cellStyle = new XSSFCellStyle(0, 0, stylesTable, null);
        columnHelper.setColDefaultStyle(11, cellStyle);
        assertEquals(0, col_2.getStyle());
        assertEquals(1, columnHelper.getColDefaultStyle(10));
    }
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.XSSFCellStyle

    // 0 is the empty default
    if(xfs.get(idx).getXfId() > 0) {
      styleXfId = (int) xfs.get(idx).getXfId();
    }

    return new XSSFCellStyle(idx, styleXfId, this, theme);
  }
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.XSSFCellStyle

    xf.setFillId(0);
    xf.setBorderId(0);
    xf.setXfId(0);
    int xfSize = styleXfs.size();
    int indexXf = putCellXf(xf);
    return new XSSFCellStyle(indexXf - 1, xfSize - 1, this, theme);
  }
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.XSSFCellStyle

    if (cell.isUnderline()) {
      font.setUnderline(Font.U_SINGLE);
    }

    XSSFCellStyle style = workbook.createCellStyle();
    style.setAlignment(this.getAlignment(cell.getAlignment()));
    style.setVerticalAlignment(this.getVerticalAlignment(cell.getVerticalAlignment()));
    style.setWrapText(cell.isWrap());
    style.setFont(font);

    if (cell.getLeftBorder() != null) {
      style.setBorderLeft((short) cell.getLeftBorder().getWidth());
      style.setLeftBorderColor(this.getColor(cell.getLeftBorder().getColor()));
    }

    if (cell.getTopBorder() != null) {
      style.setBorderTop((short) cell.getTopBorder().getWidth());
      style.setTopBorderColor(this.getColor(cell.getTopBorder().getColor()));
    }

    if (cell.getRightBorder() != null) {
      style.setBorderRight((short) cell.getRightBorder().getWidth());
      style.setRightBorderColor(this.getColor(cell.getRightBorder().getColor()));
    }

    if (cell.getBottomBorder() != null) {
      style.setBorderBottom((short) cell.getBottomBorder().getWidth());
      style.setBottomBorderColor(this.getColor(cell.getBottomBorder().getColor()));
    }

    if (cell.getBackgroundColor() != null) {
      style.setFillForegroundColor(this.getBackgroundColor(cell.getBackgroundColor()));
      style.setFillPattern(CellStyle.SOLID_FOREGROUND);
    }

    switch (cell.getType()) {
      case BLANK:
        c.setCellType(org.apache.poi.ss.usermodel.Cell.CELL_TYPE_BLANK);
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.XSSFCellStyle

      String cellStyleStr = attributes.getValue("s");
      if (cellStyleStr != null) {
        // It's a number, but almost certainly one
        // with a special style or format
        int styleIndex = Integer.parseInt(cellStyleStr);
        XSSFCellStyle style = _stylesTable.getStyleAt(styleIndex);

        configureStyle(style);

        if (_dataType == XssfDataType.NUMBER) {
          this._formatIndex = style.getDataFormat();
          this._formatString = style.getDataFormatString();
          if (this._formatString == null) {
            this._formatString = BuiltinFormats
                .getBuiltinFormat(this._formatIndex);
          }
        }
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.XSSFCellStyle

        CTCol col_2 = ctWorksheet.getColsArray(0).addNewCol();
        col_2.setMin(10);
        col_2.setMax(12);
        col_2.setStyle(1);
        assertEquals(1, columnHelper.getColDefaultStyle(11));
        XSSFCellStyle cellStyle = new XSSFCellStyle(0, 0, stylesTable);
        columnHelper.setColDefaultStyle(11, cellStyle);
        assertEquals(0, col_2.getStyle());
        assertEquals(1, columnHelper.getColDefaultStyle(10));
    }
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.XSSFCellStyle

      // 0 is the empty default
      if(xfs.get((int) idx).getXfId() > 0) {
        styleXfId = (int) xfs.get((int) idx).getXfId();
      }
     
    return new XSSFCellStyle((int) idx, styleXfId, this);
  }
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.XSSFCellStyle

      }
     
    return new XSSFCellStyle((int) idx, styleXfId, this);
  }
    public synchronized long putStyle(CellStyle style) {
      XSSFCellStyle xStyle = (XSSFCellStyle)style;
      CTXf mainXF = xStyle.getCoreXf();
     
      if(! xfs.contains(mainXF)) {
        xfs.add(mainXF);
      }
    return xfs.indexOf(mainXF);
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.XSSFCellStyle

   
    long nf1 = st.putNumberFormat("yyyy-mm-dd");
    long nf2 = st.putNumberFormat("yyyy-mm-DD");
    assertEquals(nf1, st.putNumberFormat("yyyy-mm-dd"));
   
    st.putStyle(new XSSFCellStyle(st));
   
    // Save and re-load
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    st.writeTo(baos);
    ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
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.