Commit d65426c2 by yangyang

西藏主题研判提交(西藏)

parent 7550fff1
......@@ -40,19 +40,26 @@ public class ExportExcelUtil<T> {
value++;
}
}
//创建Excel工作薄对象
HSSFWorkbook wb = new HSSFWorkbook();
//创建Excel工作表对象
HSSFSheet sheet = wb.createSheet(title);
// 设置列宽
sheet.setDefaultColumnWidth((short) 15);
// 生成一个样式
//创建单元格样式
HSSFCellStyle style = wb.createCellStyle();
//创建Excel工作表的行
HSSFRow row = sheet.createRow(0);
style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
System.out.println(HSSFWorkbook.class.getProtectionDomain().getCodeSource().getLocation());
HSSFCell cell;
Collection<String> c = headersNameMap.values();// 拿到表格所有标题的value的集合
// 拿到表格所有标题的value的集合
Collection<String> c = headersNameMap.values();
Iterator<String> it = c.iterator();// 表格标题的迭代器
// 根据选择的字段生成表头
short size = 0;
int size = 0;
while (it.hasNext()) {
System.out.println(it);
String s = it.toString();
cell = row.createCell(size);
cell.setCellValue(it.next().toString());
cell.setCellStyle(style);
......@@ -107,7 +114,7 @@ public class ExportExcelUtil<T> {
} else {
textVal = null;
}
row.createCell((short) zdCell)
row.createCell( zdCell)
.setCellValue(textVal);
zdCell++;
} catch (Exception e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment