|
|
@ -13,8 +13,8 @@ import java.util.Map;
|
|
|
|
* Create by davep at 2020-03-12 11:59
|
|
|
|
* Create by davep at 2020-03-12 11:59
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public class ExcelTemplate {
|
|
|
|
public class ExcelTemplate {
|
|
|
|
public static final CellStyleFactory STYLE_LEFT = new CellStyleFactory(CellStyle.BORDER_MEDIUM, CellStyle.ALIGN_LEFT);
|
|
|
|
public static final CellStyleFactory STYLE_LEFT = new CellStyleFactory(CellStyle.BORDER_THIN, CellStyle.ALIGN_LEFT);
|
|
|
|
public static final CellStyleFactory STYLE_RIGHT = new CellStyleFactory(CellStyle.BORDER_MEDIUM, CellStyle.ALIGN_RIGHT);
|
|
|
|
public static final CellStyleFactory STYLE_RIGHT = new CellStyleFactory(CellStyle.BORDER_THIN, CellStyle.ALIGN_RIGHT);
|
|
|
|
private Map<String, SheetTemplate> sheets;
|
|
|
|
private Map<String, SheetTemplate> sheets;
|
|
|
|
|
|
|
|
|
|
|
|
public ExcelTemplate() {
|
|
|
|
public ExcelTemplate() {
|
|
|
@ -104,7 +104,7 @@ public class ExcelTemplate {
|
|
|
|
rowNum++;
|
|
|
|
rowNum++;
|
|
|
|
Workbook workbook = sheet.getWorkbook();
|
|
|
|
Workbook workbook = sheet.getWorkbook();
|
|
|
|
Font boldFont = PoiUtils.initBoldFont(workbook);
|
|
|
|
Font boldFont = PoiUtils.initBoldFont(workbook);
|
|
|
|
CellStyle titleStyle = new CellStyleFactory(CellStyle.BORDER_MEDIUM, CellStyle.ALIGN_CENTER).buildCellStyle(workbook, boldFont);
|
|
|
|
CellStyle titleStyle = new CellStyleFactory(CellStyle.BORDER_THIN, CellStyle.ALIGN_CENTER).buildCellStyle(workbook, boldFont);
|
|
|
|
for (int i = 0, len = columns.size(); i < len; i++) {
|
|
|
|
for (int i = 0, len = columns.size(); i < len; i++) {
|
|
|
|
ColumnTemplate col = columns.get(i);
|
|
|
|
ColumnTemplate col = columns.get(i);
|
|
|
|
Cell cell = titleRow.createCell(i, Cell.CELL_TYPE_STRING);
|
|
|
|
Cell cell = titleRow.createCell(i, Cell.CELL_TYPE_STRING);
|
|
|
|