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