Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
car-database-api
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
中汽研标准应用数据库
car-database-api
Commits
51ef5643
Commit
51ef5643
authored
Sep 24, 2024
by
宋源硕
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'songyuanshuo' into 'master'
1./Plan/Record/exportTo接口修改,生成Excel的尺寸 See merge request
!21
parents
0c428301
cd3140de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
ExcelMultipleSheetsUtil.java
...c/main/java/com/ruoyi/common/ExcelMultipleSheetsUtil.java
+12
-2
No files found.
quality-review/src/main/java/com/ruoyi/common/ExcelMultipleSheetsUtil.java
View file @
51ef5643
...
@@ -259,7 +259,12 @@ public class ExcelMultipleSheetsUtil {
...
@@ -259,7 +259,12 @@ public class ExcelMultipleSheetsUtil {
Cell
serialCell
=
sheet
.
getRow
(
startRowForSerial
).
createCell
(
0
);
Cell
serialCell
=
sheet
.
getRow
(
startRowForSerial
).
createCell
(
0
);
serialCell
.
setCellValue
(
serialNumber
);
serialCell
.
setCellValue
(
serialNumber
);
serialCell
.
setCellStyle
(
getCenteredWrapTextStyle
(
sheet
.
getWorkbook
()));
serialCell
.
setCellStyle
(
getCenteredWrapTextStyle
(
sheet
.
getWorkbook
()));
}
}
sheet
.
setColumnWidth
(
0
,
20
*
200
);
sheet
.
setColumnWidth
(
1
,
20
*
500
);
sheet
.
setColumnWidth
(
2
,
20
*
500
);
sheet
.
setColumnWidth
(
3
,
20
*
700
);
}
}
...
@@ -410,14 +415,19 @@ public class ExcelMultipleSheetsUtil {
...
@@ -410,14 +415,19 @@ public class ExcelMultipleSheetsUtil {
chapterCell
.
setCellStyle
(
getCenteredWrapTextStyle
(
sheet
.
getWorkbook
()));
// 应用自动换行样式
chapterCell
.
setCellStyle
(
getCenteredWrapTextStyle
(
sheet
.
getWorkbook
()));
// 应用自动换行样式
}
}
sheet
.
setColumnWidth
(
0
,
20
*
150
);
sheet
.
setColumnWidth
(
1
,
20
*
500
);
sheet
.
setColumnWidth
(
2
,
20
*
500
);
sheet
.
setColumnWidth
(
3
,
20
*
700
);
sheet
.
setColumnWidth
(
4
,
20
*
200
);
// 自动调整列宽以适应内容
// 自动调整列宽以适应内容
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
/*
for (int i = 0; i < 5; i++) {
sheet.autoSizeColumn(i);
sheet.autoSizeColumn(i);
if (i == 2){
if (i == 2){
sheet.setColumnWidth(1,20*256);
sheet.setColumnWidth(1,20*256);
}
}
}
}
*/
}
}
// 设置表格样式
// 设置表格样式
...
...
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