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
79095838
Commit
79095838
authored
Aug 17, 2022
by
Licx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
清除数据时,公式重新计算 - 统一计算时出错会跳过
parent
56185588
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
performance/Performance.Services/ExtractExcelService/ExtractHelper/ExtractHelper.cs
+21
-2
No files found.
performance/Performance.Services/ExtractExcelService/ExtractHelper/ExtractHelper.cs
View file @
79095838
using
NPOI.SS.UserModel
;
using
NPOI.HSSF.UserModel
;
using
NPOI.SS.Formula
;
using
NPOI.SS.UserModel
;
using
NPOI.XSSF.UserModel
;
using
OfficeOpenXml
;
using
OfficeOpenXml
;
using
Performance.DtoModels
;
using
Performance.DtoModels
;
using
Performance.EntityModels
;
using
Performance.EntityModels
;
...
@@ -148,7 +151,23 @@ public static void ClearSheetPartialData(ISheet sheet, PerSheetPoint point, Shee
...
@@ -148,7 +151,23 @@ public static void ClearSheetPartialData(ISheet sheet, PerSheetPoint point, Shee
for
(
int
j
=
dataFirstCellRowNum
;
j
<
row
.
LastCellNum
;
j
++)
for
(
int
j
=
dataFirstCellRowNum
;
j
<
row
.
LastCellNum
;
j
++)
{
{
var
cell
=
row
.
GetCell
(
j
);
var
cell
=
row
.
GetCell
(
j
);
if
(
cell
!=
null
&&
(
cell
.
CellType
!=
CellType
.
Formula
||
sheetType
==
SheetType
.
Income
))
if
(
cell
==
null
)
continue
;
if
(
cell
.
CellType
==
CellType
.
Formula
)
{
try
{
BaseFormulaEvaluator
e
=
row
.
Sheet
.
Workbook
is
XSSFWorkbook
?
new
XSSFFormulaEvaluator
(
row
.
Sheet
.
Workbook
)
:
new
HSSFFormulaEvaluator
(
row
.
Sheet
.
Workbook
);
cell
=
e
.
EvaluateInCell
(
cell
);
}
catch
{
continue
;
}
}
else
if
(
cell
.
CellType
!=
CellType
.
Formula
||
sheetType
==
SheetType
.
Income
)
{
{
cell
.
RemoveCellComment
();
cell
.
RemoveCellComment
();
row
.
RemoveCell
(
cell
);
row
.
RemoveCell
(
cell
);
...
...
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