本文整理汇总了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);
}
}