poi 생성 excel 정리 (테두리/글꼴/색상/굵기/가운데/설정)

1995 단어
poi 생성 excel 정리 (테두리/글꼴/색상/굵기/가운데/설정)
HSSFWorkbook wb = new HSSFWorkbook();HSSFSheet sheet = wb.createSheet();HSSFCellStyle setBorder = wb.createCellStyle();
 、 :setBorder.setFillForegroundColor((short) 13);//  
setBorder.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
 、 :setBorder.setBorderBottom(HSSFCellStyle.BORDER_THIN); // 
setBorder.setBorderLeft(HSSFCellStyle.BORDER_THIN);// 
setBorder.setBorderTop(HSSFCellStyle.BORDER_THIN);// 
setBorder.setBorderRight(HSSFCellStyle.BORDER_THIN);// 
 、 :setBorder.setAlignment(HSSFCellStyle.ALIGN_CENTER); //  
 、 :HSSFFont font = wb.createFont();
font.setFontName(" ");
font.setFontHeightInPoints((short) 16);// HSSFFont font2 = wb.createFont();
font2.setFontName(" _GB2312");
font2.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);// 
font2.setFontHeightInPoints((short) 12);setBorder.setFont(font);// 
 、 :sheet.setColumnWidth(0, 3766); // id( 0 ), 2 
 、 :setBorder.setWrapText(true);// 
 、 :Region region1 = new Region(0, (short) 0, 0, (short) 6);// 1:   2:   3:   4: 
sheet.addMergedRegion(region1); CellRangeAddress region1 = new CellRangeAddress(rowNumber, rowNumber, (short) 0, (short) 11); , POI 。
sheet.addMergedRegion(region1); , 。
 、   HSSFCellStyle cellStyle= wookBook.createCellStyle();
  cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
  cellStyle.setBorderBottom(HSSFCellStyle.BorderBORDER_MEDIUM);
  cellStyle.setBottomBorderColor(HSSFColor.BLACK.index);
  cellStyle.setBorderLeft(HSSFCellStyle.BORDER_MEDIUM);
  cellStyle.setLeftBorderColor(HSSFColor.BLACK.index);
  cellStyle.setBorderRight(HSSFCellStyle.BORDER_MEDIUM);
  cellStyle.setRightBorderColor(HSSFColor.BLACK.index);
  cellStyle.setBorderTop(HSSFCellStyle.BORDER_MEDIUM);
  cellStyle.setTopBorderColor(HSSFColor.BLACK.index); 

좋은 웹페이지 즐겨찾기