當前位置: 首頁>>代碼示例>>Java>>正文


Java XSSFCellStyle.setVerticalAlignment方法代碼示例

本文整理匯總了Java中org.apache.poi.xssf.usermodel.XSSFCellStyle.setVerticalAlignment方法的典型用法代碼示例。如果您正苦於以下問題:Java XSSFCellStyle.setVerticalAlignment方法的具體用法?Java XSSFCellStyle.setVerticalAlignment怎麽用?Java XSSFCellStyle.setVerticalAlignment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.poi.xssf.usermodel.XSSFCellStyle的用法示例。


在下文中一共展示了XSSFCellStyle.setVerticalAlignment方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createBackgroundColorXSSFCellStyle

import org.apache.poi.xssf.usermodel.XSSFCellStyle; //導入方法依賴的package包/類
/**
 * @param wb
 * @param color
 * @param foreGround
 * @return
 */
public static XSSFCellStyle createBackgroundColorXSSFCellStyle(XSSFWorkbook wb,XSSFColor color,short foreGround){
    String message="XSSFWorkbook must not be null!";
    Objects.requireNonNull(wb, () -> message);
    XSSFCellStyle cellStyle=wb.createCellStyle();
    cellStyle.setWrapText(true);
    cellStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
    cellStyle.setAlignment(XSSFCellStyle.ALIGN_CENTER);
    cellStyle.setBorderBottom(BorderStyle.THIN);
    cellStyle.setBorderLeft(BorderStyle.THIN);
    cellStyle.setBorderTop(BorderStyle.THIN);
    cellStyle.setBorderRight(BorderStyle.THIN);
    cellStyle.setFillForegroundColor(color);
    cellStyle.setFillPattern(foreGround);
    return cellStyle;
}
 
開發者ID:gp15237125756,項目名稱:PoiExcelExport,代碼行數:22,代碼來源:XSSFCellUtil.java

示例2: createTitle

import org.apache.poi.xssf.usermodel.XSSFCellStyle; //導入方法依賴的package包/類
protected void createTitle() {
    short lineThickness = (short) (6 * BASE_HEIGHT);
    
    // Top Line
    Row row = sheet.createRow(ROW_4);
    row.setHeight(lineThickness);
    
    XSSFCellStyle style = wb.createCellStyle();
    style.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
    style.setFillPattern(CellStyle.SOLID_FOREGROUND);
    setDummyTitleStyle(row,style);
    
    // Title
    row = sheet.createRow(ROW_5);
    row.setHeightInPoints(100);
    sheet.addMergedRegion(CellRangeAddress.valueOf("B5:G5"));
    
    Font font = wb.createFont();
    font.setFontHeightInPoints((short)28);
    font.setFontName("Trebuchet MS");
    font.setBoldweight(Font.BOLDWEIGHT_BOLD);
    style = wb.createCellStyle();
    style.setFont(font);
    style.setAlignment(CellStyle.ALIGN_CENTER);
    style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);

    setDummyTitleStyle(row,style);
    row.getCell(COL_B).setCellValue("Open Source License Verification Report");
    
    // Bottom Line
    row = sheet.createRow(ROW_6);
    row.setHeight(lineThickness);
    
    style = wb.createCellStyle();
    style.setFillForegroundColor(DARK_BLUE);
    style.setFillPattern(CellStyle.SOLID_FOREGROUND);
    setDummyTitleStyle(row,style);
}
 
開發者ID:spdx,項目名稱:ATTIC-osit,代碼行數:39,代碼來源:CoverSheetTemplate.java

示例3: getCellStyle

import org.apache.poi.xssf.usermodel.XSSFCellStyle; //導入方法依賴的package包/類
/**
 * @param color
 * @param font
 * @return CellStyle
 */
protected XSSFCellStyle getCellStyle(XSSFColor color, Font font) {
    XSSFCellStyle style = wb.createCellStyle();
    style.setFillForegroundColor(color);
    style.setFillPattern(CellStyle.SOLID_FOREGROUND);
    style.setAlignment(CellStyle.ALIGN_CENTER);
    style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
    style.setWrapText(true);	// new line
    
    style.setBorderBottom(CellStyle.BORDER_THIN);
    style.setBottomBorderColor(IndexedColors.BLACK.getIndex());
    style.setBorderLeft(CellStyle.BORDER_THIN);
    style.setLeftBorderColor(IndexedColors.BLACK.getIndex());
    style.setBorderRight(CellStyle.BORDER_THIN);
    style.setRightBorderColor(IndexedColors.BLACK.getIndex());
    style.setBorderTop(CellStyle.BORDER_THIN);
    style.setTopBorderColor(IndexedColors.BLACK.getIndex());
    
    if(font != null) style.setFont(font);
    
    return style;
}
 
開發者ID:spdx,項目名稱:ATTIC-osit,代碼行數:27,代碼來源:ISheetTemplate.java

示例4: createXSSFCellStyle

import org.apache.poi.xssf.usermodel.XSSFCellStyle; //導入方法依賴的package包/類
public static XSSFCellStyle createXSSFCellStyle(XSSFWorkbook wb){
    String message="XSSFWorkbook must not be null!";
    Objects.requireNonNull(wb, () -> message);
    XSSFCellStyle cellStyle=wb.createCellStyle();
    cellStyle.setWrapText(true);
    cellStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
    cellStyle.setAlignment(XSSFCellStyle.ALIGN_CENTER);
    return cellStyle;
}
 
開發者ID:gp15237125756,項目名稱:PoiExcelExport,代碼行數:10,代碼來源:XSSFCellUtil.java

示例5: createCenterXSSFCellStyle

import org.apache.poi.xssf.usermodel.XSSFCellStyle; //導入方法依賴的package包/類
public static XSSFCellStyle createCenterXSSFCellStyle(XSSFWorkbook wb){
    String message="XSSFWorkbook must not be null!";
    Objects.requireNonNull(wb, () -> message);
    XSSFCellStyle cellStyle=wb.createCellStyle();
    cellStyle.setWrapText(true);
    cellStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
    cellStyle.setAlignment(XSSFCellStyle.ALIGN_CENTER);
    cellStyle.setBorderBottom(BorderStyle.THIN);
    cellStyle.setBorderLeft(BorderStyle.THIN);
    cellStyle.setBorderTop(BorderStyle.THIN);
    cellStyle.setBorderRight(BorderStyle.THIN);
    return cellStyle;
}
 
開發者ID:gp15237125756,項目名稱:PoiExcelExport,代碼行數:14,代碼來源:XSSFCellUtil.java

示例6: createXSSFCellStyle

import org.apache.poi.xssf.usermodel.XSSFCellStyle; //導入方法依賴的package包/類
private XSSFCellStyle createXSSFCellStyle(Workbook wb, int[] bgColor, int[] fontColor, int fontSize) {
    SXSSFWorkbook workbook = (SXSSFWorkbook) wb;
    XSSFFont titleFont = (XSSFFont) workbook.createFont();
    titleFont.setCharSet(HSSFFont.DEFAULT_CHARSET);
    titleFont.setFontName("宋體");

    XSSFColor color9 = new XSSFColor(new java.awt.Color(fontColor[0], fontColor[1], fontColor[2]));
    XSSFColor color10 = new XSSFColor(new java.awt.Color(bgColor[0], bgColor[1], bgColor[2]));
    
    if (!(fontColor[0] == 0 && fontColor[1] == 0 && fontColor[2] == 0)) {
        titleFont.setColor(color9);
    }
    titleFont.setBold(true);
    titleFont.setFontHeightInPoints((short) fontSize);

    XSSFCellStyle titleStyle = (XSSFCellStyle) createBorderCellStyle(workbook, true);
    titleStyle.setFont(titleFont);
    titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
    titleStyle.setFillForegroundColor(color10);
    titleStyle.setAlignment(HorizontalAlignment.CENTER);
    titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);

    return titleStyle;
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:25,代碼來源:TitleStyleBuilder.java

示例7: createTitleXSSFCellStyle

import org.apache.poi.xssf.usermodel.XSSFCellStyle; //導入方法依賴的package包/類
public static XSSFCellStyle createTitleXSSFCellStyle(XSSFWorkbook wb){
    String message="XSSFWorkbook must not be null!";
    Objects.requireNonNull(wb, () -> message);
    XSSFCellStyle cellStyle=wb.createCellStyle();
    cellStyle.setWrapText(true);
    cellStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
    cellStyle.setAlignment(XSSFCellStyle.ALIGN_CENTER);
    cellStyle.setBorderBottom(BorderStyle.THIN);
    cellStyle.setBorderLeft(BorderStyle.THIN);
    cellStyle.setBorderTop(BorderStyle.THIN);
    cellStyle.setBorderRight(BorderStyle.THIN);
    cellStyle.setFillForegroundColor(new XSSFColor( new Color(75, 172, 198)));
    cellStyle.setFillPattern(CellStyle.SOLID_FOREGROUND);
    return cellStyle;
}
 
開發者ID:gp15237125756,項目名稱:PoiExcelExport2.0,代碼行數:16,代碼來源:XSSFCellUtil.java

示例8: accept

import org.apache.poi.xssf.usermodel.XSSFCellStyle; //導入方法依賴的package包/類
@Override
public void accept(XSSFCellStyle style) {
    style.setAlignment(CellStyle.ALIGN_CENTER);
    style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
    //전경색
    defaultForeGround(style);
}
 
開發者ID:callakrsos,項目名稱:Gargoyle,代碼行數:8,代碼來源:FxExcelUtil.java

示例9: setStyle

import org.apache.poi.xssf.usermodel.XSSFCellStyle; //導入方法依賴的package包/類
public static XSSFCellStyle setStyle(XSSFWorkbook workbook) {  
    //設置字體;  
    XSSFFont font = workbook.createFont();  
    //設置字體大小;  
    font.setFontHeightInPoints((short) 20);  
    //設置字體名字;  
    font.setFontName("Courier New");  
    //font.setItalic(true);  
    //font.setStrikeout(true);  
    //設置樣式;  
    XSSFCellStyle style = workbook.createCellStyle();  
    //設置底邊框;  
    style.setBorderBottom(XSSFCellStyle.BORDER_THIN);  
    //設置底邊框顏色;  
    style.setBottomBorderColor(new XSSFColor(Color.BLACK));  
    //設置左邊框;  
    style.setBorderLeft(XSSFCellStyle.BORDER_THIN);  
    //設置左邊框顏色;  
    style.setLeftBorderColor(new XSSFColor(Color.BLACK));  
    //設置右邊框;  
    style.setBorderRight(XSSFCellStyle.BORDER_THIN);  
    //設置右邊框顏色;  
    style.setRightBorderColor(new XSSFColor(Color.BLACK));  
    //設置頂邊框;  
    style.setBorderTop(XSSFCellStyle.BORDER_THIN);  
    //設置頂邊框顏色;  
    style.setTopBorderColor(new XSSFColor(Color.BLACK));  
    //在樣式用應用設置的字體;  
    style.setFont(font);  
    //設置自動換行;  
    style.setWrapText(false);  
    //設置水平對齊的樣式為居中對齊;  
    style.setAlignment(XSSFCellStyle.ALIGN_CENTER);  
    //設置垂直對齊的樣式為居中對齊;  
    style.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);  
    return style;  
}
 
開發者ID:tank2140896,項目名稱:JavaWeb,代碼行數:38,代碼來源:FileUtil.java

示例10: getCellStyle

import org.apache.poi.xssf.usermodel.XSSFCellStyle; //導入方法依賴的package包/類
protected XSSFCellStyle getCellStyle(int border, Font font) {
    XSSFCellStyle style = wb.createCellStyle();
    style.setAlignment(CellStyle.ALIGN_CENTER);
    style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
    style.setWrapText(true);	// new line
    
    style.setBottomBorderColor(IndexedColors.BLACK.getIndex());
    style.setLeftBorderColor(IndexedColors.BLACK.getIndex());
    style.setRightBorderColor(IndexedColors.BLACK.getIndex());
    style.setTopBorderColor(IndexedColors.BLACK.getIndex());
    
    if((border & BORDER_BOTTOM) > 0) style.setBorderBottom(CellStyle.BORDER_DOUBLE);
    else style.setBorderBottom(CellStyle.BORDER_THIN);

    if((border & BORDER_LEFT) > 0) style.setBorderLeft(CellStyle.BORDER_DOUBLE);
    else style.setBorderLeft(CellStyle.BORDER_THIN);

    if((border & BORDER_RIGHT) > 0) style.setBorderRight(CellStyle.BORDER_DOUBLE);
    else style.setBorderRight(CellStyle.BORDER_THIN);

    if((border & BORDER_TOP) > 0) style.setBorderTop(CellStyle.BORDER_DOUBLE);
    else style.setBorderTop(CellStyle.BORDER_THIN);
    
    if(font != null) style.setFont(font);
    
    return style;
}
 
開發者ID:spdx,項目名稱:ATTIC-osit,代碼行數:28,代碼來源:CoverSheetTemplate.java

示例11: createXSSFCellStyles

import org.apache.poi.xssf.usermodel.XSSFCellStyle; //導入方法依賴的package包/類
private Map<String, CellStyle> createXSSFCellStyles(Workbook wb, int[] contextBgColor, int[] contextFontColor, int contextFontSize, int contextFontAlign, int[] headerBgColor,
        int[] headerFontColor, int headerFontSize, int headerAlign) {
    Map<String, CellStyle> styles = new HashMap<String, CellStyle>();

    SXSSFWorkbook workbook = (SXSSFWorkbook) wb;
    XSSFColor xssfContextBgColor = new XSSFColor(new java.awt.Color(contextBgColor[0], contextBgColor[1], contextBgColor[2]));
    XSSFColor xssfContextFontColor = new XSSFColor(new java.awt.Color(contextFontColor[0], contextFontColor[1], contextFontColor[2]));
    XSSFColor xssfHeaderBgColor = new XSSFColor(new java.awt.Color(headerBgColor[0], headerBgColor[1], headerBgColor[2]));
    XSSFColor xssfHeaderFontColor = new XSSFColor(new java.awt.Color(headerFontColor[0], headerFontColor[1], headerFontColor[2]));

    XSSFFont headerFont = (XSSFFont) workbook.createFont();
    headerFont.setCharSet(HSSFFont.DEFAULT_CHARSET);
    headerFont.setFontName("宋體");
    if (!(headerFontColor[0] == 0 && headerFontColor[1] == 0 && headerFontColor[2] == 0)) {
        headerFont.setColor(xssfHeaderFontColor);
    }
    headerFont.setBold(true);
    headerFont.setFontHeightInPoints((short) headerFontSize);
    XSSFCellStyle headerStyle = (XSSFCellStyle) this.createBorderCellStyle(workbook, true);
    headerStyle.setFont(headerFont);
    headerStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
    headerStyle.setFillForegroundColor(xssfHeaderBgColor);
    this.setCellStyleAligment(headerStyle, headerAlign);
    headerStyle.setVerticalAlignment(VerticalAlignment.CENTER);
    styles.put(GridStyleType.headerStyle.name(), headerStyle);

    XSSFFont dataFont = (XSSFFont) workbook.createFont();
    if (!(contextFontColor[0] == 0 && contextFontColor[1] == 0 && contextFontColor[2] == 0)) {
        dataFont.setColor(xssfContextFontColor);
    }
    dataFont.setFontHeightInPoints((short) contextFontSize);
    dataFont.setCharSet(HSSFFont.DEFAULT_CHARSET);
    dataFont.setFontName("宋體");

    XSSFCellStyle dataAlignLeftStyle = (XSSFCellStyle) this.createBorderCellStyle(workbook, true);
    dataAlignLeftStyle.setFont(dataFont);
    dataAlignLeftStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
    dataAlignLeftStyle.setFillForegroundColor(xssfContextBgColor);
    dataAlignLeftStyle.setVerticalAlignment(VerticalAlignment.CENTER);
    dataAlignLeftStyle.setWrapText(true);
    dataAlignLeftStyle.setAlignment(HorizontalAlignment.LEFT);
    styles.put(GridStyleType.dataAlignLeftStyle.name(), dataAlignLeftStyle);

    XSSFCellStyle dataAlignCenterStyle = (XSSFCellStyle) this.createBorderCellStyle(workbook, true);
    dataAlignCenterStyle.setFont(dataFont);
    dataAlignCenterStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
    dataAlignCenterStyle.setFillForegroundColor(xssfContextBgColor);
    dataAlignCenterStyle.setVerticalAlignment(VerticalAlignment.CENTER);
    dataAlignCenterStyle.setWrapText(true);
    dataAlignCenterStyle.setAlignment(HorizontalAlignment.CENTER);
    styles.put(GridStyleType.dataAlignCenterStyle.name(), dataAlignCenterStyle);

    XSSFCellStyle dataAlignRightStyle = (XSSFCellStyle) this.createBorderCellStyle(workbook, true);
    dataAlignRightStyle.setFont(dataFont);
    dataAlignRightStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
    dataAlignRightStyle.setFillForegroundColor(xssfContextBgColor);
    dataAlignRightStyle.setVerticalAlignment(VerticalAlignment.CENTER);
    dataAlignRightStyle.setWrapText(true);
    dataAlignRightStyle.setAlignment(HorizontalAlignment.RIGHT);
    styles.put(GridStyleType.dataAlignRightStyle.name(), dataAlignRightStyle);

    XSSFCellStyle dateStyle = (XSSFCellStyle) this.createBorderCellStyle(workbook, true);
    CreationHelper helper = workbook.getCreationHelper();
    dateStyle.setDataFormat(helper.createDataFormat().getFormat("m/d/yy h:mm"));
    dateStyle.setFont(dataFont);
    dateStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
    dateStyle.setFillForegroundColor(xssfContextBgColor);
    dateStyle.setVerticalAlignment(VerticalAlignment.CENTER);
    this.setCellStyleAligment(dateStyle, contextFontAlign);
    styles.put(GridStyleType.dateStyle.name(), dateStyle);

    return styles;
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:74,代碼來源:GridStyleBuilder.java

示例12: createPdcaItem

import org.apache.poi.xssf.usermodel.XSSFCellStyle; //導入方法依賴的package包/類
private int createPdcaItem(XSSFWorkbook wb, XSSFSheet sh, int row, XSSFCellStyle cellNormalStyle, List<PdcaItemVO> items, PdcaAuditVO audit) throws Exception {
    
    XSSFColor fnColor = new XSSFColor( SimpleUtils.getColorRGB4POIColor("#000000") );		
    XSSFColor bgLabelColor = new XSSFColor( SimpleUtils.getColorRGB4POIColor("#F2F2F2") );
    
    XSSFCellStyle cellLabelStyle = wb.createCellStyle();
    cellLabelStyle.setFillForegroundColor( bgLabelColor );
    cellLabelStyle.setFillPattern( FillPatternType.SOLID_FOREGROUND );				
    
    XSSFFont cellLabelFont = wb.createFont();
    cellLabelFont.setBold(true);
    cellLabelFont.setColor(fnColor);
    cellLabelStyle.setFont(cellLabelFont);		
    cellLabelStyle.setBorderBottom(BorderStyle.THIN);
    cellLabelStyle.setBorderTop(BorderStyle.THIN);
    cellLabelStyle.setBorderRight(BorderStyle.THIN);
    cellLabelStyle.setBorderLeft(BorderStyle.THIN);
    cellLabelStyle.setVerticalAlignment(VerticalAlignment.CENTER);
    cellLabelStyle.setAlignment(HorizontalAlignment.CENTER);
    cellLabelStyle.setWrapText(true);			
    
    Map<String, String> pdcaTypeMap = PdcaType.getDataMap(false);
    
    for (PdcaItemVO item : items) {
        
        Row labelRow = sh.createRow(row);
        Cell labelCell_6_1 = labelRow.createCell(0);	
        labelCell_6_1.setCellValue( pdcaTypeMap.get(item.getType()) );
        labelCell_6_1.setCellStyle(cellLabelStyle);				
        
        Cell labelCell_6_2 = labelRow.createCell(1);	
        labelCell_6_2.setCellValue( item.getTitle() + ( !StringUtils.isBlank(item.getDescription()) ? "\n\n" + item.getDescription() : "" ) );
        labelCell_6_2.setCellStyle(cellNormalStyle);	
        
        Cell labelCell_6_3 = labelRow.createCell(2);	
        labelCell_6_3.setCellValue( item.getEmployeeAppendNames() );
        labelCell_6_3.setCellStyle(cellNormalStyle);
        
        Cell labelCell_6_4 = labelRow.createCell(3);	
        labelCell_6_4.setCellValue( item.getStartDateDisplayValue() + " ~ " + item.getEndDateDisplayValue() );
        labelCell_6_4.setCellStyle(cellNormalStyle);	
        
        Cell labelCell_6_5 = labelRow.createCell(4);	
        labelCell_6_5.setCellValue( (audit != null ? audit.getEmpId() : " ") );
        labelCell_6_5.setCellStyle(cellNormalStyle);	
        
        Cell labelCell_6_6 = labelRow.createCell(5);	
        labelCell_6_6.setCellValue( (audit != null ? audit.getConfirmDateDisplayValue() : " ") );
        labelCell_6_6.setCellStyle(cellNormalStyle);
        
        
        row++;
        
    }
    
    return row;
}
 
開發者ID:billchen198318,項目名稱:bamboobsc,代碼行數:58,代碼來源:PdcaReportExcelCommand.java

示例13: createFoot

import org.apache.poi.xssf.usermodel.XSSFCellStyle; //導入方法依賴的package包/類
private void createFoot(XSSFWorkbook wb, XSSFSheet sh, int row, VisionVO vision, Context context) throws Exception {
    
    Row footRow=sh.createRow(row);
    Row footRowB=sh.createRow(row+1);
    XSSFCellStyle cellStyle=wb.createCellStyle();
    
    cellStyle.setFillForegroundColor( new XSSFColor(SimpleUtils.getColorRGB4POIColor("#FFFFFF")) );
    cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);		
    cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
    cellStyle.setBorderBottom(BorderStyle.THIN);
    cellStyle.setBorderTop(BorderStyle.THIN);
    cellStyle.setBorderRight(BorderStyle.THIN);
    cellStyle.setBorderLeft(BorderStyle.THIN);					
    XSSFFont cellFont=wb.createFont();
    cellFont.setBold(true);
    cellStyle.setFont(cellFont);
    cellStyle.setWrapText(true);		
    
    Cell footCell1 = footRow.createCell(0);
    footCell1.setCellValue("assess:");
    footCell1.setCellStyle(cellStyle);			
    Cell footCell1B = footRowB.createCell(0);
    footCell1B.setCellValue("assess:");
    footCell1B.setCellStyle(cellStyle);		
    sh.addMergedRegion(new CellRangeAddress(row, row+1, 0, 0));					
    
    Cell footCell2 = footRow.createCell(1);
    footCell2.setCellValue( BscReportPropertyUtils.getPersonalReportClassLevel() );
    footCell2.setCellStyle(cellStyle);					
    Cell footCell3 = footRow.createCell(2);
    footCell3.setCellValue( BscReportPropertyUtils.getPersonalReportClassLevel() );
    footCell3.setCellStyle(cellStyle);			
    Cell footCell4 = footRow.createCell(3);
    footCell4.setCellValue( BscReportPropertyUtils.getPersonalReportClassLevel() );
    footCell4.setCellStyle(cellStyle);			
    Cell footCell2B = footRowB.createCell(1);
    footCell2B.setCellValue( BscReportPropertyUtils.getPersonalReportClassLevel() );
    footCell2B.setCellStyle(cellStyle);					
    Cell footCell3B = footRowB.createCell(2);
    footCell3B.setCellValue( BscReportPropertyUtils.getPersonalReportClassLevel() );
    footCell3B.setCellStyle(cellStyle);			
    Cell footCell4B = footRowB.createCell(3);
    footCell4B.setCellValue( BscReportPropertyUtils.getPersonalReportClassLevel() );
    footCell4B.setCellStyle(cellStyle);					
    sh.addMergedRegion(new CellRangeAddress(row, row+1, 1, 3));	
    
    Cell footCell5 = footRow.createCell(4);
    footCell5.setCellValue("Total");
    footCell5.setCellStyle(cellStyle);	
    
    float total = 0.0f;
    if ( context.get("total")!=null && context.get("total") instanceof Float ) {
        total = (Float)context.get("total");
    }
    
    Cell footCell6 = footRow.createCell(5);
    footCell6.setCellValue( BscReportSupportUtils.parse2(total) );
    footCell6.setCellStyle(cellStyle);			
    
    Cell footCell5b = footRowB.createCell(4);
    footCell5b.setCellValue("Class");
    footCell5b.setCellStyle(cellStyle);			
    
    Cell footCell6b = footRowB.createCell(5);
    footCell6b.setCellValue( "" );
    footCell6b.setCellStyle(cellStyle);				
    
}
 
開發者ID:billchen198318,項目名稱:bamboobsc,代碼行數:69,代碼來源:PersonalReportExcelCommand.java


注:本文中的org.apache.poi.xssf.usermodel.XSSFCellStyle.setVerticalAlignment方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。