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
e5a05a84
Commit
e5a05a84
authored
Jun 02, 2021
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合并空行BUG
parent
3540e3ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
11 deletions
+18
-11
ExcelConsole.java
...-db/src/main/java/com/yanzuoguang/excel/ExcelConsole.java
+18
-11
No files found.
yzg-util-db/src/main/java/com/yanzuoguang/excel/ExcelConsole.java
View file @
e5a05a84
...
@@ -59,6 +59,10 @@ public class ExcelConsole<T extends Object> implements DbRow<T> {
...
@@ -59,6 +59,10 @@ public class ExcelConsole<T extends Object> implements DbRow<T> {
* 行号
* 行号
*/
*/
private
int
rowIndex
;
private
int
rowIndex
;
/**
* 行数据
*/
private
int
rowData
;
/**
/**
* 合并列表組
* 合并列表組
...
@@ -309,6 +313,7 @@ public class ExcelConsole<T extends Object> implements DbRow<T> {
...
@@ -309,6 +313,7 @@ public class ExcelConsole<T extends Object> implements DbRow<T> {
}
}
rowIndex
++;
rowIndex
++;
rowData
++;
if
(
this
.
rowIndex
%
100
==
0
)
{
if
(
this
.
rowIndex
%
100
==
0
)
{
FileHelper
.
writeFile
(
new
File
(
this
.
getFileNameRow
()),
StringHelper
.
toString
(
this
.
rowIndex
),
"utf-8"
);
FileHelper
.
writeFile
(
new
File
(
this
.
getFileNameRow
()),
StringHelper
.
toString
(
this
.
rowIndex
),
"utf-8"
);
...
@@ -363,18 +368,20 @@ public class ExcelConsole<T extends Object> implements DbRow<T> {
...
@@ -363,18 +368,20 @@ public class ExcelConsole<T extends Object> implements DbRow<T> {
return
this
;
return
this
;
}
}
// 合并数据配置
// 合并数据配置
int
columnPos
=
0
;
if
(
this
.
rowData
>
0
){
for
(
ExportColumn
column
:
this
.
config
.
getColumns
())
{
int
columnPos
=
0
;
mergerColumn
(
column
,
columnPos
,
true
);
for
(
ExportColumn
column
:
this
.
config
.
getColumns
())
{
mergerColumn
(
column
,
columnPos
,
true
);
if
(
column
.
getWidth
()
<
1
)
{
//设置单元格长度, 这里要乘上256
if
(
column
.
getWidth
()
<
1
)
{
int
maxBytes
=
columnBytes
.
get
(
columnPos
);
//设置单元格长度, 这里要乘上256
sheet
.
setColumnWidth
(
columnPos
,
maxBytes
*
256
);
int
maxBytes
=
columnBytes
.
get
(
columnPos
);
}
else
{
sheet
.
setColumnWidth
(
columnPos
,
maxBytes
*
256
);
sheet
.
setColumnWidth
(
columnPos
,
getUnit
(
column
.
getWidth
()));
}
else
{
sheet
.
setColumnWidth
(
columnPos
,
getUnit
(
column
.
getWidth
()));
}
columnPos
++;
}
}
columnPos
++;
}
}
try
{
try
{
...
...
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