Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YZG
yzg-util
Commits
cd7e4c03
Commit
cd7e4c03
authored
Mar 25, 2023
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EXCEL边框的处理
parent
1008d812
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
0 deletions
+64
-0
ExcelConsole.java
...-db/src/main/java/com/yanzuoguang/excel/ExcelConsole.java
+12
-0
ExcelDefineCell.java
.../src/main/java/com/yanzuoguang/excel/ExcelDefineCell.java
+52
-0
No files found.
yzg-util-db/src/main/java/com/yanzuoguang/excel/ExcelConsole.java
View file @
cd7e4c03
...
...
@@ -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
;
}
...
...
yzg-util-db/src/main/java/com/yanzuoguang/excel/ExcelDefineCell.java
View file @
cd7e4c03
...
...
@@ -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
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment