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
d80ba249
Commit
d80ba249
authored
Mar 01, 2024
by
wyc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(提取时)excel如果没有筛选 保存报错问题处理
parent
b51941de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
+7
-1
performance/Performance.Services/ExtractExcelService/ExtractHelper/ExtractHelper.cs
+7
-1
No files found.
performance/Performance.Services/ExtractExcelService/ExtractHelper/ExtractHelper.cs
View file @
d80ba249
...
...
@@ -211,18 +211,24 @@ public static void CloseAutoFilter(string path)
ExcelWorkbook
workbook
=
package
.
Workbook
;
if
(
workbook
==
null
)
return
;
bool
shouldSave
=
false
;
// 标志是否需要保存文件
foreach
(
var
sheet
in
workbook
.
Worksheets
)
{
if
(
sheet
.
AutoFilterAddress
!=
null
)
{
sheet
.
Cells
[
sheet
.
AutoFilterAddress
.
Address
].
AutoFilter
=
false
;
shouldSave
=
true
;
// 设置标志为需要保存文件
}
}
package
.
Save
();
if
(
shouldSave
)
{
package
.
Save
();
}
}
}
catch
(
Exception
)
{
}
}
...
...
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