Package org.apache.poi.ss.usermodel

Examples of org.apache.poi.ss.usermodel.Workbook.createCellStyle()


    Font font = wb.createFont();
    font.setBoldweight(Font.BOLDWEIGHT_BOLD);  
//-------------------------------sheet1-----------------------------------------------------   
    Row firstrow = sheet1.createRow((short) 0)
    CellStyle firstrow_style = wb.createCellStyle();
    firstrow_style.setFillForegroundColor(IndexedColors.LIGHT_CORNFLOWER_BLUE.getIndex());
    firstrow_style.setFillPattern(CellStyle.SOLID_FOREGROUND);
    firstrow_style.setFont(font);
   
    //Border for first row
View Full Code Here


    Cell firstRowCell1 = firstrow.createCell((short) 1);
    firstRowCell1.setCellValue("Count");
    firstRowCell1.setCellStyle(firstrow_style);
   
    //Border for row
    CellStyle row_style = wb.createCellStyle();
    row_style.setBorderBottom( CellStyle.BORDER_THIN );
    row_style.setBorderLeft( CellStyle.BORDER_THIN );
    row_style.setBorderRight( CellStyle.BORDER_THIN );
    row_style.setBorderTop( CellStyle.BORDER_THIN );
    row_style.setBorderLeft( CellStyle.BORDER_THIN );
View Full Code Here

    Font font = wb.createFont();
    font.setBoldweight(Font.BOLDWEIGHT_BOLD);  
//-------------------------------sheet1-----------------------------------------------------   
    Row firstrow = sheet1.createRow((short) 0)
    CellStyle firstrow_style = wb.createCellStyle();
    firstrow_style.setFillForegroundColor(IndexedColors.LIGHT_CORNFLOWER_BLUE.getIndex());
    firstrow_style.setFillPattern(CellStyle.SOLID_FOREGROUND);
    firstrow_style.setFont(font);
   
    //Border for first row
View Full Code Here

    Cell firstRowCell1 = firstrow.createCell((short) 1);
    firstRowCell1.setCellValue("Count");
    firstRowCell1.setCellStyle(firstrow_style);
   
    //Border for row
    CellStyle row_style = wb.createCellStyle();
    row_style.setBorderBottom( CellStyle.BORDER_THIN );
    row_style.setBorderLeft( CellStyle.BORDER_THIN );
    row_style.setBorderRight( CellStyle.BORDER_THIN );
    row_style.setBorderTop( CellStyle.BORDER_THIN );
    row_style.setBorderLeft( CellStyle.BORDER_THIN );
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

      font.setFontName("Courier New");
      font.setItalic(true);
      font.setStrikeout(true);

      // Fonts are set into a style so create a new one to use.
      CellStyle style = wb.createCellStyle();
      style.setFont(font);

      // Create a cell and put a value in it.
      Cell cell = row.createCell(1);
      cell.setCellValue("This is a test of fonts");
View Full Code Here

      font.setFontHeightInPoints((short)24);
      font.setFontName(FONT_TYPE);
      font.setColor(FONT_COLOR_TITLE);

      /***  Header *****/
      CellStyle style = wb.createCellStyle();
      style.setFont(font);
      style.setAlignment(CellStyle.ALIGN_CENTER);
      style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
      style.setFillForegroundColor(BACKGROUND_COLOR);      

View Full Code Here

      font = wb.createFont();
      font.setFontHeightInPoints((short)12);
      font.setFontName(FONT_TYPE);
      font.setColor(FONT_COLOR);
     
      style = wb.createCellStyle();
      style.setFont(font);
     
      rowNum =  rowNum + 3;
     List<Account> accounts = accountManager.getAllAccounts();
     for (Account account : accounts) {
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.