Package org.apache.poi.hssf.usermodel

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


        lhs.setAlignment(HSSFCellStyle.ALIGN_RIGHT);
       
        HSSFCellStyle tar = wb.createCellStyle();
        tar.setAlignment(HSSFCellStyle.ALIGN_CENTER);
       
        HSSFCellStyle rhs = wb.createCellStyle();
        rhs.setAlignment(HSSFCellStyle.ALIGN_LEFT);
       
        int ii;
        row = sheet.createRow((short)0); // blank line
        cell = row.createCell((short)0);
View Full Code Here


        assertEquals(IndexedColors.AUTOMATIC.getIndex(), style1.getFillBackgroundColor());
        assertNull(style1.getFillBackgroundXSSFColor());

        //compatibility with HSSF
        HSSFWorkbook wb2 = new HSSFWorkbook();
        HSSFCellStyle style2 = wb2.createCellStyle();
        assertEquals(style2.getFillBackgroundColor(), style1.getFillBackgroundColor());
        assertEquals(style2.getFillForegroundColor(), style1.getFillForegroundColor());
        assertEquals(style2.getFillPattern(), style1.getFillPattern());

        assertEquals(style2.getLeftBorderColor(), style1.getLeftBorderColor());
View Full Code Here

        worksheet.createRow((short)2);

        row = worksheet.createRow((short)3);

        HSSFCellStyle style = wb.createCellStyle();
        style.setBorderBottom(HSSFCellStyle.BORDER_THIN);
        font = wb.createFont();
        font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);

        value = new HSSFRichTextString("Name");
View Full Code Here

        worksheet.createRow(2);

        row = worksheet.createRow(3);

        HSSFCellStyle style = wb.createCellStyle();
        style.setBorderBottom(HSSFCellStyle.BORDER_THIN);
        font = wb.createFont();
        font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);

        value = new HSSFRichTextString("Name");
View Full Code Here

     */
    protected void processarXLS(Object document, String sheetName) {
        HSSFWorkbook wb = (HSSFWorkbook) document;
        wb.setSheetName(0, sheetName);
        HSSFSheet sheet = wb.getSheetAt(0);
        CellStyle style = wb.createCellStyle();
        style.setFillPattern(CellStyle.SOLID_FOREGROUND);
        style.setFillForegroundColor(IndexedColors.LIGHT_BLUE.getIndex());
        for (Cell cell : sheet.getRow(0))
            cell.setCellStyle(style);

View Full Code Here

        static Cell createCell(int row, int column, Date date) {
        Workbook workbook = new HSSFWorkbook();
        Sheet sheet = workbook.createSheet();
        Cell cell = sheet.createRow(row).createCell(column, CELL_TYPE_NUMERIC);
        cell.setCellValue(date);
        CellStyle style = workbook.createCellStyle();
        style.setDataFormat(workbook.getCreationHelper().createDataFormat().getFormat("m/d/yy h:mm"));
        cell.setCellStyle(style);
        return cell;
    }
View Full Code Here

      int recordNumber = 0;

      HSSFWorkbook workbook = new HSSFWorkbook();
      HSSFSheet sheet = workbook.createSheet();

      HSSFCellStyle cellStyle_varchar = workbook.createCellStyle();
      cellStyle_varchar.setAlignment(HSSFCellStyle.ALIGN_LEFT);

      HSSFCellStyle cellStyle_title = workbook.createCellStyle();
      cellStyle_title.setAlignment(HSSFCellStyle.ALIGN_CENTER);
View Full Code Here

      HSSFSheet sheet = workbook.createSheet();

      HSSFCellStyle cellStyle_varchar = workbook.createCellStyle();
      cellStyle_varchar.setAlignment(HSSFCellStyle.ALIGN_LEFT);

      HSSFCellStyle cellStyle_title = workbook.createCellStyle();
      cellStyle_title.setAlignment(HSSFCellStyle.ALIGN_CENTER);

      HSSFCellStyle cellStyle_char = workbook.createCellStyle();
      cellStyle_char.setAlignment(HSSFCellStyle.ALIGN_LEFT);
View Full Code Here

      cellStyle_varchar.setAlignment(HSSFCellStyle.ALIGN_LEFT);

      HSSFCellStyle cellStyle_title = workbook.createCellStyle();
      cellStyle_title.setAlignment(HSSFCellStyle.ALIGN_CENTER);

      HSSFCellStyle cellStyle_char = workbook.createCellStyle();
      cellStyle_char.setAlignment(HSSFCellStyle.ALIGN_LEFT);

      HSSFCellStyle cellStyle_date = workbook.createCellStyle();
      cellStyle_date.setAlignment(HSSFCellStyle.ALIGN_CENTER);
      cellStyle_date.setDataFormat(HSSFDataFormat.getBuiltinFormat("m/d/yy h:mm"));
View Full Code Here

      cellStyle_title.setAlignment(HSSFCellStyle.ALIGN_CENTER);

      HSSFCellStyle cellStyle_char = workbook.createCellStyle();
      cellStyle_char.setAlignment(HSSFCellStyle.ALIGN_LEFT);

      HSSFCellStyle cellStyle_date = workbook.createCellStyle();
      cellStyle_date.setAlignment(HSSFCellStyle.ALIGN_CENTER);
      cellStyle_date.setDataFormat(HSSFDataFormat.getBuiltinFormat("m/d/yy h:mm"));

      HSSFCellStyle cellStyle_timestamp = workbook.createCellStyle();
      cellStyle_timestamp.setAlignment(HSSFCellStyle.ALIGN_CENTER);
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.