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
49223dfe
Commit
49223dfe
authored
Feb 28, 2023
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设置单元格的值
parent
efe320d2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
13 deletions
+25
-13
ExcelConsole.java
...-db/src/main/java/com/yanzuoguang/excel/ExcelConsole.java
+25
-13
No files found.
yzg-util-db/src/main/java/com/yanzuoguang/excel/ExcelConsole.java
View file @
49223dfe
...
...
@@ -287,19 +287,6 @@ public class ExcelConsole<T extends Object> implements DbRow<T> {
}
}
/**
* 开始生成Excel文件
*
* @return 当前对象
*/
public
ExcelConsole
<
T
>
open
()
{
this
.
check
();
TableHead
head
=
this
.
initHead
();
initExcel
(
head
);
return
this
;
}
private
void
writeDefineRow
(
List
<
ExcelDefineRow
>
rows
)
{
// 创建行
for
(
ExcelDefineRow
row
:
rows
)
{
...
...
@@ -308,12 +295,37 @@ public class ExcelConsole<T extends Object> implements DbRow<T> {
for
(
ExcelDefineCell
cell
:
row
.
getCells
())
{
cell
.
cellStyle
=
createCellStyle
(
cell
);
cell
.
cell
=
createCell
(
sheetRow
,
cell
.
getColumn
(),
cell
.
getValue
(),
cell
.
cellStyle
);
// 合并单元格
if
(
cell
.
getWidthSize
()
>
1
||
cell
.
getHeightSize
()
>
1
)
{
int
rowStart
=
rowIndex
;
int
rowEnd
=
rowStart
+
cell
.
getHeightSize
()
-
1
;
int
columnStart
=
cell
.
getColumn
();
int
columnEnd
=
columnStart
+
cell
.
getWidthSize
()
-
1
;
CellRangeAddress
region
=
new
CellRangeAddress
(
rowStart
,
rowEnd
,
columnStart
,
columnEnd
);
sheet
.
addMergedRegion
(
region
);
setDefaultStyle
(
region
,
cell
.
cellStyle
);
}
}
rowIndex
++;
}
}
private
void
writeDefineFormula
(
List
<
ExcelDefineRow
>
rows
)
{
}
/**
* 开始生成Excel文件
*
* @return 当前对象
*/
public
ExcelConsole
<
T
>
open
()
{
this
.
check
();
TableHead
head
=
this
.
initHead
();
initExcel
(
head
);
return
this
;
}
/**
...
...
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