|
@@ -21,6 +21,7 @@ import org.apache.poi.hssf.usermodel.HSSFSheet;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
|
|
|
import com.diagbot.dto.RespDTO;
|
|
|
+import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
|
|
|
|
|
@SuppressWarnings( { "deprecation" })
|
|
|
public class ExportBeanExcelUtil<T> {
|
|
@@ -63,7 +64,7 @@ import com.diagbot.dto.RespDTO;
|
|
|
// 生成一个样式
|
|
|
HSSFCellStyle style = wb.createCellStyle();
|
|
|
HSSFRow row = sheet.createRow(0);
|
|
|
-// style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
|
|
|
+ style.setAlignment(HorizontalAlignment.CENTER);
|
|
|
HSSFCell cell;
|
|
|
Collection c = headersNameMap.values();//拿到表格所有标题的value的集合
|
|
|
Iterator<String> it = c.iterator();//表格标题的迭代器
|