Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
performance
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zry
performance
Commits
a19c74c2
Commit
a19c74c2
authored
Dec 16, 2021
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导出Excel样式调整
parent
3dd3d5a8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
performance/Performance.Services/DownloadService.cs
+18
-5
No files found.
performance/Performance.Services/DownloadService.cs
View file @
a19c74c2
...
...
@@ -197,11 +197,12 @@ public string AllComputerViewReport(int allotId, List<dynamic> dynamics, string
if
(
dynamics
!=
null
&&
dynamics
.
Count
()
>
0
)
{
worksheet
.
SetValue
(
1
,
1
,
$"
{
allot
.
Year
}
年
{
allot
.
Month
}
月
{
hospital
.
HosName
}
医院 ---
{
name
}
"
);
var
headers
=
((
IDictionary
<
string
,
object
>)
dynamics
.
ElementAt
(
0
)).
Keys
;
for
(
int
col
=
0
;
col
<
headList
.
Count
;
col
++)
{
worksheet
.
SetValue
(
1
,
col
+
1
,
headList
[
col
].
Alias
);
worksheet
.
SetValue
(
2
,
col
+
1
,
headList
[
col
].
Alias
);
}
for
(
int
col
=
0
;
col
<
headList
.
Count
;
col
++)
{
...
...
@@ -211,24 +212,36 @@ public string AllComputerViewReport(int allotId, List<dynamic> dynamics, string
var
temp
=
(
IDictionary
<
string
,
object
>)
data
;
var
value
=
temp
[
headList
[
col
].
Name
];
worksheet
.
Cells
[
row
+
2
,
col
+
1
].
Value
=
value
;
worksheet
.
Cells
[
row
+
3
,
col
+
1
].
Value
=
value
;
}
if
(
col
==
0
)
worksheet
.
SetValue
(
dynamics
.
Count
()
+
2
,
col
+
1
,
"合计"
);
else
worksheet
.
Cells
[
dynamics
.
Count
()
+
2
,
col
+
1
].
Formula
=
string
.
Format
(
"SUM({0})"
,
new
ExcelAddress
(
2
,
col
+
1
,
dynamics
.
Count
()
+
1
,
col
+
1
).
Address
);
}
}
worksheet
.
View
.
FreezePanes
(
2
,
1
);
#
region
样式设置
for
(
int
row
=
worksheet
.
Dimension
.
Start
.
Row
;
row
<=
worksheet
.
Dimension
.
End
.
Row
;
row
++)
{
worksheet
.
Row
(
row
).
Height
=
20
;
for
(
int
col
=
worksheet
.
Dimension
.
Start
.
Column
;
col
<=
worksheet
.
Dimension
.
End
.
Column
;
col
++)
{
worksheet
.
Cells
[
row
,
col
].
Style
.
Border
.
BorderAround
(
ExcelBorderStyle
.
Thin
);
worksheet
.
Cells
[
row
,
col
].
Style
.
Numberformat
.
Format
=
"#,##0.00"
;
worksheet
.
Cells
[
row
,
col
].
Style
.
VerticalAlignment
=
ExcelVerticalAlignment
.
Center
;
}
}
worksheet
.
Cells
[
1
,
1
,
1
,
headList
.
Count
].
Merge
=
true
;
worksheet
.
Cells
[
1
,
1
,
1
,
headList
.
Count
].
Style
.
VerticalAlignment
=
ExcelVerticalAlignment
.
Center
;
worksheet
.
Cells
[
1
,
1
,
1
,
headList
.
Count
].
Style
.
HorizontalAlignment
=
ExcelHorizontalAlignment
.
Center
;
worksheet
.
Cells
[
1
,
1
,
1
,
headList
.
Count
].
Style
.
Font
.
Bold
=
true
;
worksheet
.
Cells
[
1
,
1
,
1
,
headList
.
Count
].
Style
.
Font
.
Size
=
16
;
worksheet
.
Row
(
1
).
Height
=
24
;
worksheet
.
Cells
[
2
,
1
,
2
,
headList
.
Count
].
Style
.
Font
.
Bold
=
true
;
worksheet
.
View
.
FreezePanes
(
3
,
1
);
worksheet
.
Cells
.
AutoFitColumns
();
#
endregion
}
package
.
Save
();
}
return
filepath
;
...
...
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