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


Java Row.setHeightInPoints方法代碼示例

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


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

示例1: createSheetDataRow

import org.apache.poi.ss.usermodel.Row; //導入方法依賴的package包/類
private static <T> void createSheetDataRow(List<T> dataList, int dataRowNum,
		int listStart, int listEnd,ExportInfo exportInfo,
		Map<Field, CellStyle> dataCellStyleMap, List<Field> availableFields,Sheet sheet)
		throws IllegalAccessException, InvocationTargetException {
	
	Map<Field, ExportFieldInfo> fieldInfoMap = exportInfo.getFieldInfoMap();
	Cell cell;
	Field field;
	Row row;
	T obj ;
	int dataSize = dataList.size() ;
	listEnd = listEnd > dataSize ? dataSize : listEnd ;
	int fieldListSize = availableFields.size();
	int dataHightInPoint = exportInfo.getDataHightInPoint();
	for(int i = listStart ; i < listEnd ; i++ , dataRowNum ++){
		obj = dataList.get(i);
		row = sheet.createRow(dataRowNum ); 
		row.setHeightInPoints(dataHightInPoint);
		for(int j = 0 ; j < fieldListSize ; j++){
			field = availableFields.get(j);
			if(field == null ){
				continue;
			}
			cell= row.createCell(j);
			Object returnVal = obj;
			List<Method> methods = fieldInfoMap.get(field).getMethodChain();
			for(Method method : methods){
				if (returnVal == null) {
					continue;
				}
				returnVal = method.invoke(returnVal);
			}
			
			setCellValue(cell, fieldInfoMap.get(field),  returnVal, obj);
			if(dataCellStyleMap != null && dataCellStyleMap.get(field) != null){
				cell.setCellStyle(dataCellStyleMap.get(field));					
			}
		}
	}
}
 
開發者ID:long47964,項目名稱:excel-utils,代碼行數:41,代碼來源:ExcelExportUtil.java

示例2: createSummaryColumns

import org.apache.poi.ss.usermodel.Row; //導入方法依賴的package包/類
private void createSummaryColumns(Sheet sheet) {
	Row headerRow = sheet.createRow(ROW_INDEX_COLUMNS_DESCRIPTIONS);
	headerRow.setHeightInPoints(40);
	Cell headerCell;
	for (int i = 0; i < titlesSummary.length; i++) {
		headerCell = headerRow.createCell(i);
		headerCell.setCellValue(titlesSummary[i]);
		headerCell.setCellStyle(styles.get("header"));
	}
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:11,代碼來源:XLTestSummarySheet.java

示例3: createTitle

import org.apache.poi.ss.usermodel.Row; //導入方法依賴的package包/類
private void createTitle(Sheet sheet, String xl_sheet_title) {
	Row titleRow = sheet.createRow(ROW_INDEX_TITLE);
	titleRow.setHeightInPoints(45);
	Cell titleCell = titleRow.createCell(0);
	titleCell.setCellValue(xl_sheet_title);
	titleCell.setCellStyle(styles.get("title"));
	sheet.addMergedRegion(CellRangeAddress.valueOf("$A$1:$F$1"));
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:9,代碼來源:XLTestSummarySheet.java

示例4: createHeader

import org.apache.poi.ss.usermodel.Row; //導入方法依賴的package包/類
private int createHeader(Sheet sheet, int rowNum, String[] titles) {
	Row headerRow = sheet.createRow(rowNum);
	headerRow.setHeightInPoints(40);
	Cell headerCell;
	int[] cols = new int[titles.length];
	for (int i = 0; i < titles.length; i++) {
		cols[i] = i;
		headerCell = headerRow.createCell(i);
		headerCell.setCellValue(titles[i]);
		headerCell.setCellStyle(styles.get("header"));
	}
	autoSize(sheet, cols);
	return rowNum;
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:15,代碼來源:XLTestDetailsSheet.java

示例5: initialize

import org.apache.poi.ss.usermodel.Row; //導入方法依賴的package包/類
/**
 * 初始化函數
 * @param title 表格標題,傳“空值”,表示無標題
 * @param headerList 表頭列表
 */
private void initialize(String title, List<String> headerList) {
    this.wb = new SXSSFWorkbook(500);
    this.sheet = wb.createSheet("Export");
    this.styles = createStyles(wb);
    // Create title
    if (StringUtils.isNotBlank(title)){
        Row titleRow = sheet.createRow(rownum++);
        titleRow.setHeightInPoints(30);
        Cell titleCell = titleRow.createCell(0);
        titleCell.setCellStyle(styles.get("title"));
        titleCell.setCellValue(title);
        sheet.addMergedRegion(new CellRangeAddress(titleRow.getRowNum(),
                titleRow.getRowNum(), titleRow.getRowNum(), headerList.size()-1));
    }
    // Create header
    if (headerList == null){
        throw new RuntimeException("headerList not null!");
    }
    Row headerRow = sheet.createRow(rownum++);
    headerRow.setHeightInPoints(16);
    for (int i = 0; i < headerList.size(); i++) {
        Cell cell = headerRow.createCell(i);
        cell.setCellStyle(styles.get("header"));
        String[] ss = StringUtils.split(headerList.get(i), "**", 2);
        if (ss.length==2){
            cell.setCellValue(ss[0]);
            Comment comment = this.sheet.createDrawingPatriarch().createCellComment(
                    new XSSFClientAnchor(0, 0, 0, 0, (short) 3, 3, (short) 5, 6));
            comment.setString(new XSSFRichTextString(ss[1]));
            cell.setCellComment(comment);
        }else{
            cell.setCellValue(headerList.get(i));
        }
        sheet.autoSizeColumn(i);
    }
    for (int i = 0; i < headerList.size(); i++) {
        int colWidth = sheet.getColumnWidth(i)*2;
        sheet.setColumnWidth(i, colWidth < 3000 ? 3000 : colWidth);
    }
    log.debug("Initialize success.");
}
 
開發者ID:sombie007,項目名稱:ExcelHandle,代碼行數:47,代碼來源:ExportExcel.java


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