if (path == null && titles != null) {
sheet.createRow(rowIndex);
HSSFRow row = sheet.createRow(rowIndex);
for (String title : titles) {
row.createCell((short) columnIndex).setCellValue(
new HSSFRichTextString(title));
columnIndex++;
}
rowIndex++;
columnIndex = left;
}
for (int i = 0; i < size; i++) {
// 填充每一行
List<?> list = rows.get(i);
int rowSize = list.size();
for (int j = 0; j < rowSize; j++) {
// 填充每一列
Object value = list.get(j);
if (value != null) {
// 等于空时跳过这一次存储
sheet.createRow(rowIndex).createCell((short) columnIndex)
.setCellValue(new HSSFRichTextString(value.toString()));
}
// 如果定义了填充格式, 则需要计算新的单元格位置
if (format != null) {
rowIndex += format[j][0];
columnIndex += format[j][1];