}
row.createCell(columnIndex).setCellValue("Penalty");
int rowIndex = 6;
for (RankListEntry rankListEntry : entries) {
RankListEntry entry = rankListEntry;
row = sheet.createRow(rowIndex);
row.createCell((short) 0).setCellValue(rowIndex - 5);
row.createCell((short) 1).setCellValue(entry.getUserProfile().getHandle());
String nick = entry.getUserProfile().getHandle();
if (entry.getUserProfile().getNickName() != null) {
nick = entry.getUserProfile().getNickName();
}
cell = row.createCell((short) 2);
cell.setEncoding(HSSFCell.ENCODING_UTF_16);
cell.setCellValue(nick);
row.createCell((short) 3).setCellValue(entry.getSolved());
for (short i = 0; i < problems.size(); ++i) {
String score =
entry.getAcceptTime(i) > 0 ? entry.getAcceptTime(i) + "(" + entry.getSubmitNumber(i) + ")"
: "" + entry.getSubmitNumber(i);
row.createCell((short) (4 + i)).setCellValue(score);
}
row.createCell((short) (4 + problems.size())).setCellValue(entry.getPenalty());
rowIndex++;
}
// output to stream
ByteArrayOutputStream out = new ByteArrayOutputStream();