Commit cd7e4c03 authored by yanzg's avatar yanzg

EXCEL边框的处理

parent 1008d812
......@@ -658,6 +658,18 @@ public class ExcelConsole<T extends Object> implements DbRow<T> {
CellStyle style = this.createStyle(this.workbook, false);
setAlignment(style, cell.getAlignment());
setVerticalAlignment(style, cell.getVerticalAlignment());
if (!cell.isTopBorder()) {
style.setBorderTop(CellStyle.BORDER_NONE);
}
if (!cell.isBottomBorder()) {
style.setBorderBottom(CellStyle.BORDER_NONE);
}
if (!cell.isLeftBorder()) {
style.setBorderLeft(CellStyle.BORDER_NONE);
}
if (!cell.isRightBorder()) {
style.setBorderRight(CellStyle.BORDER_NONE);
}
return style;
}
......
......@@ -55,6 +55,26 @@ public class ExcelDefineCell {
"数据结束行={endDataRowIndex}" +
"数据所有单元格={columnName}={columnName_COL}{startDataRowIndex}:{columnName_COL}{endDataRowIndex}")
private String formula;
/**
* 上边框
*/
@ApiModelProperty(notes = "上边框")
private boolean topBorder = true;
/**
* 下边框
*/
@ApiModelProperty(notes = "下边框")
private boolean bottomBorder = true;
/**
* 左边框
*/
@ApiModelProperty(notes = "左边框")
private boolean leftBorder = true;
/**
* 下边框
*/
@ApiModelProperty(notes = "下边框")
private boolean rightBorder = true;
/**
* 当前单元格样式
*/
......@@ -119,4 +139,36 @@ public class ExcelDefineCell {
public void setFormula(String formula) {
this.formula = formula;
}
public boolean isTopBorder() {
return topBorder;
}
public void setTopBorder(boolean topBorder) {
this.topBorder = topBorder;
}
public boolean isBottomBorder() {
return bottomBorder;
}
public void setBottomBorder(boolean bottomBorder) {
this.bottomBorder = bottomBorder;
}
public boolean isLeftBorder() {
return leftBorder;
}
public void setLeftBorder(boolean leftBorder) {
this.leftBorder = leftBorder;
}
public boolean isRightBorder() {
return rightBorder;
}
public void setRightBorder(boolean rightBorder) {
this.rightBorder = rightBorder;
}
}
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