当前位置: 首页>>代码示例>>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;未经允许,请勿转载。