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 2222
2323
2424 <ItemGroup >
25- <PackageReference Include =" DocumentFormat.OpenXml" Version =" 2.20 .0" />
25+ <PackageReference Include =" DocumentFormat.OpenXml" Version =" 3.2 .0" />
2626 </ItemGroup >
2727</Project >
Original file line number Diff line number Diff line change @@ -650,7 +650,7 @@ public void Save()
650650 public void Save ( string filePath )
651651 {
652652 this . workbookpart . Workbook . Save ( ) ;
653- this . spreadsheetDocument . Close ( ) ;
653+ this . spreadsheetDocument . Dispose ( ) ;
654654
655655 File . WriteAllBytes ( filePath , this . ms . ToArray ( ) ) ; // Write the MemoryStream back to the file
656656 }
@@ -663,7 +663,7 @@ public void Save(Stream stream)
663663
664664 var clonedDocument = this . spreadsheetDocument . Clone ( stream ) ;
665665 workbookpart . Workbook . Save ( ) ;
666- spreadsheetDocument . Close ( ) ;
666+ spreadsheetDocument . Dispose ( ) ;
667667 stream . Close ( ) ;
668668
669669 }
Original file line number Diff line number Diff line change @@ -827,18 +827,23 @@ private ValidationRule CreateValidationRuleFromDataValidation(DataValidation dat
827827
828828 private ValidationType DetermineValidationType ( DataValidationValues openXmlType )
829829 {
830+ var values = Enum . GetNames ( typeof ( DataValidationValues ) ) ;
831+ Console . WriteLine ( "Available DataValidationValues:" ) ;
832+ foreach ( var value in values )
833+ {
834+ Console . WriteLine ( value ) ;
835+ }
830836 // Map the OpenXML DataValidationValues to your ValidationType enum
831837 // This mapping depends on how closely your ValidationType enum aligns with OpenXML's types
832838 // Example mapping:
833- switch ( openXmlType )
839+ switch ( openXmlType . ToString ( ) ) // If DataValidationValues is now a string enum
834840 {
835- case DataValidationValues . List :
841+ case " List" :
836842 return ValidationType . List ;
837- case DataValidationValues . Custom :
843+ case " Custom" :
838844 return ValidationType . CustomFormula ;
839- // Map other types...
840845 default :
841- throw new NotImplementedException ( "Validation type not supported." ) ;
846+ throw new NotImplementedException ( $ "Validation type ' { openXmlType } ' not supported.") ;
842847 }
843848 }
844849
Original file line number Diff line number Diff line change 1616 <PackageReference Include =" MSTest.TestAdapter" Version =" 2.2.10" />
1717 <PackageReference Include =" MSTest.TestFramework" Version =" 2.2.10" />
1818 <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" />
2020 </ItemGroup >
2121
2222 <ItemGroup >
Original file line number Diff line number Diff line change 11MIT License
22
3- Copyright (c) 2024 Aspose Pty Ltd
3+ Copyright (c) 2025 Aspose Pty Ltd
44
55Permission is hereby granted, free of charge, to any person obtaining a copy
66of this software and associated documentation files (the "Software"), to deal
You can’t perform that action at this time.
0 commit comments