当前位置: 首页>>代码示例>>Java>>正文


Java HSSFSheet.groupRow方法代码示例

本文整理汇总了Java中org.apache.poi.hssf.usermodel.HSSFSheet.groupRow方法的典型用法代码示例。如果您正苦于以下问题:Java HSSFSheet.groupRow方法的具体用法?Java HSSFSheet.groupRow怎么用?Java HSSFSheet.groupRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.poi.hssf.usermodel.HSSFSheet的用法示例。


在下文中一共展示了HSSFSheet.groupRow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeActorsSummary

import org.apache.poi.hssf.usermodel.HSSFSheet; //导入方法依赖的package包/类
private void writeActorsSummary(HSSFWorkbook workbook, List<ActorDynamicData> actorsData) {
	HSSFSheet worksheet = workbook.createSheet("Actors Summary");

	// row 0: title
	int cRow = 0;
	HSSFRow row = worksheet.createRow(cRow);
	HSSFCell cell = row.createCell(0);
	cell.setCellValue("Actors and actions operator calls");
	setBold(workbook, cell, (short) 14);

	cRow++;
	row = worksheet.createRow(cRow);
	cell = row.createCell(0);
	cell.setCellValue("Actor");
	setBold(workbook, cell);
	cell = row.createCell(1);
	cell.setCellValue("Operator");
	setBold(workbook, cell);
	cell = row.createCell(2);
	cell.setCellValue("Mean");
	setBold(workbook, cell);
	cell = row.createCell(3);
	cell.setCellValue("Min");
	setBold(workbook, cell);
	cell = row.createCell(4);
	cell.setCellValue("Max");
	setBold(workbook, cell);
	cell = row.createCell(5);
	cell.setCellValue("Sum");
	setBold(workbook, cell);
	// row 1: actor | operator | values

	for (ActorDynamicData aData : actorsData) {
		cRow++;
		row = worksheet.createRow(cRow);

		int initialRow = cRow;
		Map<EOperator, StatisticalData> opsMap = aData.getOperandsCalls();
		StatisticalData s = sum(opsMap.values());
		row.createCell(0).setCellValue(aData.getActor().getName());
		row.createCell(2).setCellValue(s.getMean());
		row.createCell(3).setCellValue(s.getMin());
		row.createCell(4).setCellValue(s.getMax());
		row.createCell(5).setCellValue(s.getSum());

		// operands details
		for (Entry<EOperator, StatisticalData> e : opsMap.entrySet()) {
			s = e.getValue();

			cRow++;
			row = worksheet.createRow(cRow);
			row.createCell(1).setCellValue(e.getKey().getLiteral());
			row.createCell(2).setCellValue(s.getMean());
			row.createCell(3).setCellValue(s.getMin());
			row.createCell(4).setCellValue(s.getMax());
			row.createCell(5).setCellValue(s.getSum());
		}
		worksheet.groupRow(initialRow + 1, cRow);
		worksheet.setRowGroupCollapsed(initialRow + 1, true);
	}

}
 
开发者ID:turnus,项目名称:turnus,代码行数:63,代码来源:Dprof2XlsExporter.java


注:本文中的org.apache.poi.hssf.usermodel.HSSFSheet.groupRow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。