File tree Expand file tree Collapse file tree 6 files changed +15
-20
lines changed Expand file tree Collapse file tree 6 files changed +15
-20
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 22
22
23
23
24
24
<ItemGroup >
25
- <PackageReference Include =" DocumentFormat.OpenXml" Version =" 2.20 .0" />
25
+ <PackageReference Include =" DocumentFormat.OpenXml" Version =" 3.2 .0" />
26
26
</ItemGroup >
27
27
</Project >
Original file line number Diff line number Diff line change @@ -650,7 +650,7 @@ public void Save()
650
650
public void Save ( string filePath )
651
651
{
652
652
this . workbookpart . Workbook . Save ( ) ;
653
- this . spreadsheetDocument . Close ( ) ;
653
+ this . spreadsheetDocument . Dispose ( ) ;
654
654
655
655
File . WriteAllBytes ( filePath , this . ms . ToArray ( ) ) ; // Write the MemoryStream back to the file
656
656
}
@@ -663,7 +663,7 @@ public void Save(Stream stream)
663
663
664
664
var clonedDocument = this . spreadsheetDocument . Clone ( stream ) ;
665
665
workbookpart . Workbook . Save ( ) ;
666
- spreadsheetDocument . Close ( ) ;
666
+ spreadsheetDocument . Dispose ( ) ;
667
667
stream . Close ( ) ;
668
668
669
669
}
Original file line number Diff line number Diff line change @@ -827,18 +827,23 @@ private ValidationRule CreateValidationRuleFromDataValidation(DataValidation dat
827
827
828
828
private ValidationType DetermineValidationType ( DataValidationValues openXmlType )
829
829
{
830
+ var values = Enum . GetNames ( typeof ( DataValidationValues ) ) ;
831
+ Console . WriteLine ( "Available DataValidationValues:" ) ;
832
+ foreach ( var value in values )
833
+ {
834
+ Console . WriteLine ( value ) ;
835
+ }
830
836
// Map the OpenXML DataValidationValues to your ValidationType enum
831
837
// This mapping depends on how closely your ValidationType enum aligns with OpenXML's types
832
838
// Example mapping:
833
- switch ( openXmlType )
839
+ switch ( openXmlType . ToString ( ) ) // If DataValidationValues is now a string enum
834
840
{
835
- case DataValidationValues . List :
841
+ case " List" :
836
842
return ValidationType . List ;
837
- case DataValidationValues . Custom :
843
+ case " Custom" :
838
844
return ValidationType . CustomFormula ;
839
- // Map other types...
840
845
default :
841
- throw new NotImplementedException ( "Validation type not supported." ) ;
846
+ throw new NotImplementedException ( $ "Validation type ' { openXmlType } ' not supported.") ;
842
847
}
843
848
}
844
849
Original file line number Diff line number Diff line change 16
16
<PackageReference Include =" MSTest.TestAdapter" Version =" 2.2.10" />
17
17
<PackageReference Include =" MSTest.TestFramework" Version =" 2.2.10" />
18
18
<PackageReference Include =" coverlet.collector" Version =" 3.2.0" />
19
- <PackageReference Include =" DocumentFormat.OpenXml" Version =" 2.20 .0" />
19
+ <PackageReference Include =" DocumentFormat.OpenXml" Version =" 3.2 .0" />
20
20
</ItemGroup >
21
21
22
22
<ItemGroup >
Original file line number Diff line number Diff line change 1
1
MIT License
2
2
3
- Copyright (c) 2024 Aspose Pty Ltd
3
+ Copyright (c) 2025 Aspose Pty Ltd
4
4
5
5
Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
of this software and associated documentation files (the "Software"), to deal
You can’t perform that action at this time.
0 commit comments