diff --git a/ClosedXML/ClosedXML/ClosedXML.sln b/ClosedXML/ClosedXML/ClosedXML.sln index 16c7cbf..a7e7b21 100644 --- a/ClosedXML/ClosedXML/ClosedXML.sln +++ b/ClosedXML/ClosedXML/ClosedXML.sln @@ -64,8 +64,8 @@ {03A518D0-1CB7-488E-861C-C4E782B27A46}.Debug|x86.Build.0 = Debug|x86 {03A518D0-1CB7-488E-861C-C4E782B27A46}.Release|Any CPU.ActiveCfg = Release|Any CPU {03A518D0-1CB7-488E-861C-C4E782B27A46}.Release|Any CPU.Build.0 = Release|Any CPU - {03A518D0-1CB7-488E-861C-C4E782B27A46}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {03A518D0-1CB7-488E-861C-C4E782B27A46}.Release|Mixed Platforms.Build.0 = Release|x86 + {03A518D0-1CB7-488E-861C-C4E782B27A46}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {03A518D0-1CB7-488E-861C-C4E782B27A46}.Release|Mixed Platforms.Build.0 = Release|Any CPU {03A518D0-1CB7-488E-861C-C4E782B27A46}.Release|x64.ActiveCfg = Release|x64 {03A518D0-1CB7-488E-861C-C4E782B27A46}.Release|x64.Build.0 = Release|x64 {03A518D0-1CB7-488E-861C-C4E782B27A46}.Release|x86.ActiveCfg = Release|Any CPU @@ -92,8 +92,8 @@ {38B882F0-E6F2-45C5-9BE9-CDC27FBEB4AB}.Debug|x86.Build.0 = Debug|x86 {38B882F0-E6F2-45C5-9BE9-CDC27FBEB4AB}.Release|Any CPU.ActiveCfg = Release|Any CPU {38B882F0-E6F2-45C5-9BE9-CDC27FBEB4AB}.Release|Any CPU.Build.0 = Release|Any CPU - {38B882F0-E6F2-45C5-9BE9-CDC27FBEB4AB}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {38B882F0-E6F2-45C5-9BE9-CDC27FBEB4AB}.Release|Mixed Platforms.Build.0 = Release|x86 + {38B882F0-E6F2-45C5-9BE9-CDC27FBEB4AB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {38B882F0-E6F2-45C5-9BE9-CDC27FBEB4AB}.Release|Mixed Platforms.Build.0 = Release|Any CPU {38B882F0-E6F2-45C5-9BE9-CDC27FBEB4AB}.Release|x64.ActiveCfg = Release|x64 {38B882F0-E6F2-45C5-9BE9-CDC27FBEB4AB}.Release|x64.Build.0 = Release|x64 {38B882F0-E6F2-45C5-9BE9-CDC27FBEB4AB}.Release|x86.ActiveCfg = Release|Any CPU @@ -124,8 +124,8 @@ {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Debug|x86.Build.0 = Debug|x86 {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Release|Any CPU.ActiveCfg = Release|Any CPU {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Release|Any CPU.Build.0 = Release|Any CPU - {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Release|Mixed Platforms.ActiveCfg = Release|x64 - {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Release|Mixed Platforms.Build.0 = Release|x64 + {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Release|Mixed Platforms.Build.0 = Release|Any CPU {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Release|x64.ActiveCfg = Release|x64 {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Release|x64.Build.0 = Release|x64 {BD5E6BFE-E837-4A35-BCA9-39667D873A20}.Release|x86.ActiveCfg = Release|Any CPU diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/IXLCFColorScaleMax.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/IXLCFColorScaleMax.cs index bd1d315..391ed17 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/IXLCFColorScaleMax.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/IXLCFColorScaleMax.cs @@ -8,6 +8,7 @@ public interface IXLCFColorScaleMax { void Maximum(XLCFContentType type, String value, IXLColor color); + void Maximum(XLCFContentType type, Double value, IXLColor color); void HighestValue(IXLColor color); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/IXLCFColorScaleMid.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/IXLCFColorScaleMid.cs index e04cb1c..74e0f39 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/IXLCFColorScaleMid.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/IXLCFColorScaleMid.cs @@ -8,7 +8,9 @@ public interface IXLCFColorScaleMid { IXLCFColorScaleMax Midpoint(XLCFContentType type, String value, IXLColor color); + IXLCFColorScaleMax Midpoint(XLCFContentType type, Double value, IXLColor color); void Maximum(XLCFContentType type, String value, IXLColor color); + void Maximum(XLCFContentType type, Double value, IXLColor color); void HighestValue(IXLColor color); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/IXLCFColorScaleMin.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/IXLCFColorScaleMin.cs index aaad72a..d32392f 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/IXLCFColorScaleMin.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/IXLCFColorScaleMin.cs @@ -9,6 +9,7 @@ public interface IXLCFColorScaleMin { IXLCFColorScaleMid Minimum(XLCFContentType type, String value, IXLColor color); + IXLCFColorScaleMid Minimum(XLCFContentType type, Double value, IXLColor color); IXLCFColorScaleMid LowestValue(IXLColor color); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/IXLCFDataBarMax.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/IXLCFDataBarMax.cs index b5627e5..16341e3 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/IXLCFDataBarMax.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/IXLCFDataBarMax.cs @@ -8,6 +8,7 @@ public interface IXLCFDataBarMax { void Maximum(XLCFContentType type, String value); + void Maximum(XLCFContentType type, Double value); void HighestValue(); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/IXLCFDataBarMin.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/IXLCFDataBarMin.cs index 968606a..a3d5e73 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/IXLCFDataBarMin.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/IXLCFDataBarMin.cs @@ -8,6 +8,7 @@ public interface IXLCFDataBarMin { IXLCFDataBarMax Minimum(XLCFContentType type, String value); + IXLCFDataBarMax Minimum(XLCFContentType type, Double value); IXLCFDataBarMax LowestValue(); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/IXLCFIconSet.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/IXLCFIconSet.cs index f67b986..a5a361f 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/IXLCFIconSet.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/IXLCFIconSet.cs @@ -9,5 +9,6 @@ public interface IXLCFIconSet { IXLCFIconSet AddValue(XLCFIconSetOperator setOperator, String value, XLCFContentType type); + IXLCFIconSet AddValue(XLCFIconSetOperator setOperator, Double value, XLCFContentType type); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/XLCFColorScaleMax.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/XLCFColorScaleMax.cs index cef3f58..ed22b92 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/XLCFColorScaleMax.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/XLCFColorScaleMax.cs @@ -19,6 +19,10 @@ _conditionalFormat.Colors.Add(color); _conditionalFormat.ContentTypes.Add(type); } + public void Maximum(XLCFContentType type, Double value, IXLColor color) + { + Maximum(type, value.ToString(), color); + } public void HighestValue(IXLColor color) { Maximum(XLCFContentType.Maximum, "0", color); diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/XLCFColorScaleMid.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/XLCFColorScaleMid.cs index 40fbf22..524558f 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/XLCFColorScaleMid.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/XLCFColorScaleMid.cs @@ -19,10 +19,18 @@ _conditionalFormat.ContentTypes.Add(type); return new XLCFColorScaleMax(_conditionalFormat); } + public IXLCFColorScaleMax Midpoint(XLCFContentType type, Double value, IXLColor color) + { + return Midpoint(type, value.ToString(), color); + } public void Maximum(XLCFContentType type, String value, IXLColor color) { Midpoint(type, value, color); } + public void Maximum(XLCFContentType type, Double value, IXLColor color) + { + Maximum(type, value.ToString(), color); + } public void HighestValue(IXLColor color) { Midpoint(XLCFContentType.Maximum, "0", color); diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/XLCFColorScaleMin.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/XLCFColorScaleMin.cs index f9cfb44..50c4f73 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/XLCFColorScaleMin.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/XLCFColorScaleMin.cs @@ -20,6 +20,10 @@ _conditionalFormat.ContentTypes.Initialize(type); return new XLCFColorScaleMid(_conditionalFormat); } + public IXLCFColorScaleMid Minimum(XLCFContentType type, Double value, IXLColor color) + { + return Minimum(type, value.ToString(), color); + } public IXLCFColorScaleMid LowestValue(IXLColor color) { diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/XLCFDataBarMax.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/XLCFDataBarMax.cs index 4079d58..004e68d 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/XLCFDataBarMax.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/XLCFDataBarMax.cs @@ -18,6 +18,10 @@ _conditionalFormat.ContentTypes.Add(type); _conditionalFormat.Values.Add(value); } + public void Maximum(XLCFContentType type, Double value) + { + Maximum(type, value.ToString()); + } public void HighestValue() { diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/XLCFDataBarMin.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/XLCFDataBarMin.cs index c7399d4..83ad237 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/XLCFDataBarMin.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/XLCFDataBarMin.cs @@ -19,6 +19,10 @@ _conditionalFormat.Values.Initialize(value); return new XLCFDataBarMax(_conditionalFormat); } + public IXLCFDataBarMax Minimum(XLCFContentType type, Double value) + { + return Minimum(type, value.ToString()); + } public IXLCFDataBarMax LowestValue() { diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/XLCFIconSet.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/XLCFIconSet.cs index c9914b7..21c0899 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/XLCFIconSet.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/ConditionalFormats/XLCFIconSet.cs @@ -19,5 +19,9 @@ _conditionalFormat.ContentTypes.Add(type); return new XLCFIconSet(_conditionalFormat); } + public IXLCFIconSet AddValue(XLCFIconSetOperator setOperator, Double value, XLCFContentType type) + { + return AddValue(setOperator, value.ToString(), type); + } } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Properties/AssemblyInfo.cs b/ClosedXML/ClosedXML/ClosedXML/Properties/AssemblyInfo.cs index 0e076ac..c7b3197 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Properties/AssemblyInfo.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Properties/AssemblyInfo.cs @@ -31,6 +31,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.64.0.0")] -[assembly: AssemblyFileVersion("0.64.0.0")] +[assembly: AssemblyVersion("0.65.0.0")] +[assembly: AssemblyFileVersion("0.65.0.0")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("ClosedXML_Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100a1fb8ba59167fe734d64128ca73d32c45cb8a117246d09c95c8769db88fe332b0a3396bedd0ea48ee42b0e5796fec0798ca5cb628a9a6de80d35d6c67b936ca1670347b3d4f2b769c8ce2ddcf959dbac6bcd88e6c08751ea1fffa0522de3507193e7035305a8aa008d6c88cca1341b3120fa9c347ab3f97e2d772e2709277da5")] \ No newline at end of file diff --git a/ClosedXML/ClosedXML/ClosedXML_Examples/ConditionalFormatting/ConditionalFormatting.cs b/ClosedXML/ClosedXML/ClosedXML_Examples/ConditionalFormatting/ConditionalFormatting.cs index ee5332d..f87825b 100644 --- a/ClosedXML/ClosedXML/ClosedXML_Examples/ConditionalFormatting/ConditionalFormatting.cs +++ b/ClosedXML/ClosedXML/ClosedXML_Examples/ConditionalFormatting/ConditionalFormatting.cs @@ -580,13 +580,15 @@ var workbook = new XLWorkbook(); var ws = workbook.AddWorksheet("Sheet1"); - ws.Cell(2, 1).SetValue("1") - .CellRight().SetValue("1") - .CellRight().SetValue("2") - .CellRight().SetValue("3"); + ws.FirstCell().SetValue(1) + .CellBelow().SetValue(1) + .CellBelow().SetValue(2) + .CellBelow().SetValue(3) + .CellBelow().SetValue(4); - ws.RangeUsed().AddConditionalFormat().WhenEquals("1").Fill.SetBackgroundColor(XLColor.Red); - ws.Range("B2:C2").InsertRowsBelow(1); + ws.RangeUsed().AddConditionalFormat().DataBar(XLColor.Red) + .LowestValue() + .HighestValue(); workbook.SaveAs(filePath); } diff --git a/ClosedXML/ClosedXML/ClosedXML_Net3.5/Properties/AssemblyInfo.cs b/ClosedXML/ClosedXML/ClosedXML_Net3.5/Properties/AssemblyInfo.cs index 0e1d43f..369adb3 100644 --- a/ClosedXML/ClosedXML/ClosedXML_Net3.5/Properties/AssemblyInfo.cs +++ b/ClosedXML/ClosedXML/ClosedXML_Net3.5/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.64.0.0")] -[assembly: AssemblyFileVersion("0.64.0.0")] +[assembly: AssemblyVersion("0.65.0.0")] +[assembly: AssemblyFileVersion("0.65.0.0")] diff --git a/ClosedXML/ClosedXML/ClosedXML_Tests/ClosedXML_Tests.csproj b/ClosedXML/ClosedXML/ClosedXML_Tests/ClosedXML_Tests.csproj index 2f53574..226787b 100644 --- a/ClosedXML/ClosedXML/ClosedXML_Tests/ClosedXML_Tests.csproj +++ b/ClosedXML/ClosedXML/ClosedXML_Tests/ClosedXML_Tests.csproj @@ -230,6 +230,8 @@ + + diff --git a/ClosedXML/ClosedXML/ClosedXML_Tests/Examples/ConditionalFormattingTests.cs b/ClosedXML/ClosedXML/ClosedXML_Tests/Examples/ConditionalFormattingTests.cs index bf4eb6f..5e6585f 100644 --- a/ClosedXML/ClosedXML/ClosedXML_Tests/Examples/ConditionalFormattingTests.cs +++ b/ClosedXML/ClosedXML/ClosedXML_Tests/Examples/ConditionalFormattingTests.cs @@ -91,17 +91,17 @@ TestHelper.RunTestExample(@"ConditionalFormatting\CFNotEqualsNumber.xlsx"); } - //[TestMethod] - //public void XXX() - //{ - // TestHelper.RunTestExample(@"ConditionalFormatting\XXX.xlsx"); - //} - // - //[TestMethod] - //public void XXX() - //{ - // TestHelper.RunTestExample(@"ConditionalFormatting\XXX.xlsx"); - //} + [TestMethod] + public void CFDataBar() + { + TestHelper.RunTestExample(@"ConditionalFormatting\CFDataBar.xlsx"); + } + + [TestMethod] + public void CFIconSet() + { + TestHelper.RunTestExample(@"ConditionalFormatting\CFIconSet.xlsx"); + } // //[TestMethod] //public void XXX() diff --git a/ClosedXML/ClosedXML/ClosedXML_Tests/Resource/Examples/ConditionalFormatting/CFDataBar.xlsx b/ClosedXML/ClosedXML/ClosedXML_Tests/Resource/Examples/ConditionalFormatting/CFDataBar.xlsx new file mode 100644 index 0000000..4c83b25 --- /dev/null +++ b/ClosedXML/ClosedXML/ClosedXML_Tests/Resource/Examples/ConditionalFormatting/CFDataBar.xlsx Binary files differ diff --git a/ClosedXML/ClosedXML/ClosedXML_Tests/Resource/Examples/ConditionalFormatting/CFIconSet.xlsx b/ClosedXML/ClosedXML/ClosedXML_Tests/Resource/Examples/ConditionalFormatting/CFIconSet.xlsx new file mode 100644 index 0000000..3bab878 --- /dev/null +++ b/ClosedXML/ClosedXML/ClosedXML_Tests/Resource/Examples/ConditionalFormatting/CFIconSet.xlsx Binary files differ