Package org.apache.poi.hssf.usermodel

Examples of org.apache.poi.hssf.usermodel.HSSFWorkbook.createCellStyle()


        HSSFWorkbook wb = spreadsheet.getWorkbook();
        HSSFFont font = wb.createFont();
        font.setColor(HSSFColor.BLACK.index);
        font.setFontHeightInPoints((short) 8);
        HSSFCellStyle redStyle = wb.createCellStyle();
        redStyle.setFont(font);
        redStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
        redStyle.setFillForegroundColor(HSSFColor.ORANGE.index);
        redStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
        HSSFCellStyle yellowStyle = wb.createCellStyle();
View Full Code Here


        HSSFCellStyle redStyle = wb.createCellStyle();
        redStyle.setFont(font);
        redStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
        redStyle.setFillForegroundColor(HSSFColor.ORANGE.index);
        redStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
        HSSFCellStyle yellowStyle = wb.createCellStyle();
        yellowStyle.setFont(font);
        yellowStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
        yellowStyle.setFillForegroundColor(HSSFColor.YELLOW.index);
        yellowStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
View Full Code Here

      HSSFCell tempCell = firstRow.createCell((short)(j+1));
      tempCell.setCellValue(displayNames[j]);
    }
   
   
    HSSFCellStyle linkStyle = wb.createCellStyle();
    HSSFFont cellFont= wb.createFont();
    cellFont.setUnderline((byte) 1);
    cellFont.setColor(HSSFColor.BLUE.index);
    linkStyle.setFont(cellFont);
View Full Code Here

        FileOutputStream out    = new FileOutputStream(filename);
        HSSFWorkbook     wb     = new HSSFWorkbook();
        HSSFSheet        s      = wb.createSheet();
        HSSFRow          r      = null;
        HSSFCell         c      = null;
        HSSFCellStyle    cs     = wb.createCellStyle();
        HSSFCellStyle    cs2    = wb.createCellStyle();
        HSSFCellStyle    cs3    = wb.createCellStyle();
        HSSFFont         f      = wb.createFont();
        HSSFFont         f2     = wb.createFont();
View Full Code Here

        HSSFWorkbook     wb     = new HSSFWorkbook();
        HSSFSheet        s      = wb.createSheet();
        HSSFRow          r      = null;
        HSSFCell         c      = null;
        HSSFCellStyle    cs     = wb.createCellStyle();
        HSSFCellStyle    cs2    = wb.createCellStyle();
        HSSFCellStyle    cs3    = wb.createCellStyle();
        HSSFFont         f      = wb.createFont();
        HSSFFont         f2     = wb.createFont();

        f.setFontHeightInPoints(( short ) 12);
View Full Code Here

        HSSFSheet        s      = wb.createSheet();
        HSSFRow          r      = null;
        HSSFCell         c      = null;
        HSSFCellStyle    cs     = wb.createCellStyle();
        HSSFCellStyle    cs2    = wb.createCellStyle();
        HSSFCellStyle    cs3    = wb.createCellStyle();
        HSSFFont         f      = wb.createFont();
        HSSFFont         f2     = wb.createFont();

        f.setFontHeightInPoints(( short ) 12);
        f.setColor(( short ) 0xA);
View Full Code Here

        DataFormat format = xwb.createDataFormat();
      xstyle.setDataFormat(format.getFormat("YYYY-MM-DD"));
      xcell.setCellStyle(xstyle);

      hcell.setCellValue(cal.getTime());
      CellStyle hstyle=hwb.createCellStyle();
        DataFormat hformat = hwb.createDataFormat();
      hstyle.setDataFormat(hformat.getFormat("YYYY-MM-DD"));
      hcell.setCellStyle(hstyle);
     
      assertEquals(hcell.toString(),xcell.toString());
View Full Code Here

      // Create a cell and put a value in it.
      Cell cell = row.createCell(1);
      cell.setCellValue(4);

      // Style the cell with borders all around.
      CellStyle style = wb.createCellStyle();
      style.setBorderBottom(CellStyle.BORDER_THIN);
      style.setBottomBorderColor(IndexedColors.BLACK.getIndex());
     
      style.setBorderLeft(CellStyle.BORDER_THIN);
      style.setLeftBorderColor(IndexedColors.GREEN.getIndex());
View Full Code Here

      // Create a row and put some cells in it. Rows are 0 based.
      Row row = sheet.createRow((short) 1);

      // Aqua background
      CellStyle style = wb.createCellStyle();
      style.setFillBackgroundColor(IndexedColors.AQUA.getIndex());
      style.setFillPattern(CellStyle.BIG_SPOTS);
      Cell cell = row.createCell((short) 1);
      cell.setCellValue("X");
      cell.setCellStyle(style);
View Full Code Here

      Cell cell = row.createCell((short) 1);
      cell.setCellValue("X");
      cell.setCellStyle(style);

      // Orange "foreground", foreground being the fill foreground not the font color.
      style = wb.createCellStyle();
      style.setFillForegroundColor(IndexedColors.ORANGE.getIndex());
      style.setFillPattern(CellStyle.SOLID_FOREGROUND);
      cell = row.createCell((short) 2);
      cell.setCellValue("X");
      cell.setCellStyle(style);
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.