diff --git a/ClosedXML/ClosedXML/ClosedXML/ClosedXML.csproj b/ClosedXML/ClosedXML/ClosedXML/ClosedXML.csproj index 6c069fa..a0d026e 100644 --- a/ClosedXML/ClosedXML/ClosedXML/ClosedXML.csproj +++ b/ClosedXML/ClosedXML/ClosedXML/ClosedXML.csproj @@ -121,6 +121,12 @@ + + + + + + diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Charts/IXLChart.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Charts/IXLChart.cs new file mode 100644 index 0000000..01d1def --- /dev/null +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Charts/IXLChart.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ClosedXML.Excel +{ + public interface IXLChart + { + IXLDrawingPosition Position { get; } + } +} diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Charts/IXLCharts.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Charts/IXLCharts.cs new file mode 100644 index 0000000..af62fca --- /dev/null +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Charts/IXLCharts.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ClosedXML.Excel +{ + public interface IXLCharts: IEnumerable + { + } +} diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Charts/IXLDrawingPosition.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Charts/IXLDrawingPosition.cs new file mode 100644 index 0000000..bebd9e5 --- /dev/null +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Charts/IXLDrawingPosition.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ClosedXML.Excel +{ + public enum XLDrawingAnchor { MoveAndSizeWithCells, MoveWithCells, Absolute} + public interface IXLDrawingPosition + { + XLDrawingAnchor Anchor { get; set; } + Int32 ZOrder { get; set; } + } +} diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Charts/XLChart.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Charts/XLChart.cs new file mode 100644 index 0000000..70d4ebc --- /dev/null +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Charts/XLChart.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ClosedXML.Excel +{ + internal class XLChart: IXLChart + { + public XLChart() + { + Position = new XLDrawingPosition(); + } + IXLDrawingPosition Position { get; set; } + + IXLDrawingPosition IXLChart.Position + { + get { throw new NotImplementedException(); } + } + } +} diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Charts/XLCharts.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Charts/XLCharts.cs new file mode 100644 index 0000000..e444b08 --- /dev/null +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Charts/XLCharts.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ClosedXML.Excel +{ + internal class XLCharts: IXLCharts + { + public IEnumerator GetEnumerator() + { + throw new NotImplementedException(); + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + throw new NotImplementedException(); + } + } +} diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Charts/XLDrawingPosition.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Charts/XLDrawingPosition.cs new file mode 100644 index 0000000..6d11dd1 --- /dev/null +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Charts/XLDrawingPosition.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ClosedXML.Excel +{ + internal class XLDrawingPosition: IXLDrawingPosition + { + public XLDrawingAnchor Anchor + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public int ZOrder + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + } +} diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/IXLColumn.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/IXLColumn.cs index 2d2dd2b..0c4eb65 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/IXLColumn.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/IXLColumn.cs @@ -163,5 +163,9 @@ IXLColumn Sort(XLSortOrder sortOrder, Boolean matchCase); IXLRangeColumn Column(Int32 start, Int32 end); + + IXLColumn Replace(String oldValue, String newValue); + IXLColumn Replace(String oldValue, String newValue, XLSearchContents searchContents); + IXLColumn Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/IXLColumns.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/IXLColumns.cs index 1dd77a9..52761d3 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/IXLColumns.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/IXLColumns.cs @@ -104,5 +104,9 @@ IXLCells CellsUsed(Boolean includeStyles); IXLStyle Style { get; set; } + + IXLColumns Replace(String oldValue, String newValue); + IXLColumns Replace(String oldValue, String newValue, XLSearchContents searchContents); + IXLColumns Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/XLColumn.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/XLColumn.cs index 4fba1b2..6c23fb8 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/XLColumn.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/XLColumn.cs @@ -549,5 +549,21 @@ { return AsRange().Range(start, 1, end, 1).Column(1); } + + public new IXLColumn Replace(String oldValue, String newValue) + { + base.Replace(oldValue, newValue); + return this; + } + public new IXLColumn Replace(String oldValue, String newValue, XLSearchContents searchContents) + { + base.Replace(oldValue, newValue, searchContents); + return this; + } + public new IXLColumn Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions) + { + base.Replace(oldValue, newValue, searchContents, useRegularExpressions); + return this; + } } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/XLColumns.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/XLColumns.cs index 45ae353..28cc7d9 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/XLColumns.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Columns/XLColumns.cs @@ -245,5 +245,21 @@ return retVal; } } + + public IXLColumns Replace(String oldValue, String newValue) + { + columns.ForEach(r => r.Replace(oldValue, newValue)); + return this; + } + public IXLColumns Replace(String oldValue, String newValue, XLSearchContents searchContents) + { + columns.ForEach(r => r.Replace(oldValue, newValue, searchContents)); + return this; + } + public IXLColumns Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions) + { + columns.ForEach(r => r.Replace(oldValue, newValue, searchContents, useRegularExpressions)); + return this; + } } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/IXLWorksheet.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/IXLWorksheet.cs index bd9ba23..79fe6da 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/IXLWorksheet.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/IXLWorksheet.cs @@ -286,5 +286,21 @@ IXLRange Sort(XLSortOrientation sortOrientation, Boolean matchCase); IXLRange Sort(XLSortOrientation sortOrientation, XLSortOrder sortOrder, Boolean matchCase); IXLRange Sort(XLSortOrientation sortOrientation, String elementsToSortBy, Boolean matchCase); + + IXLCharts Charts { get; } + + IXLRows FindRows(String search); + IXLRows FindRows(String search, XLSearchContents searchContents); + IXLRows FindRows(String search, XLSearchContents searchContents, Boolean useRegularExpressions); + IXLRows FindRows(String search, XLSearchContents searchContents, Boolean matchCase, Boolean entireCell); + + IXLColumns FindColumns(String search); + IXLColumns FindColumns(String search, XLSearchContents searchContents); + IXLColumns FindColumns(String search, XLSearchContents searchContents, Boolean useRegularExpressions); + IXLColumns FindColumns(String search, XLSearchContents searchContents, Boolean matchCase, Boolean entireCell); + + IXLWorksheet Replace(String oldValue, String newValue); + IXLWorksheet Replace(String oldValue, String newValue, XLSearchContents searchContents); + IXLWorksheet Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/IXLWorksheets.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/IXLWorksheets.cs index 910a62b..7fb62f2 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/IXLWorksheets.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/IXLWorksheets.cs @@ -13,5 +13,9 @@ IXLWorksheet Add(String sheetName, Int32 position); void Delete(String sheetName); void Delete(Int32 position); + + IXLWorksheets Replace(String oldValue, String newValue); + IXLWorksheets Replace(String oldValue, String newValue, XLSearchContents searchContents); + IXLWorksheets Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRange.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRange.cs index 8ff7875..a1d0002 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRange.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRange.cs @@ -8,7 +8,7 @@ { public enum XLShiftDeletedCells { ShiftCellsUp, ShiftCellsLeft } public enum XLTransposeOptions { MoveCells, ReplaceCells } - + public enum XLSearchContents { Values, Formulas, ValuesAndFormulas } public interface IXLRange: IXLRangeBase { /// @@ -239,6 +239,20 @@ IXLRange Sort(XLSortOrientation sortOrientation, Boolean matchCase); IXLRange Sort(XLSortOrientation sortOrientation, XLSortOrder sortOrder, Boolean matchCase); IXLRange Sort(XLSortOrientation sortOrientation, String elementsToSortBy, Boolean matchCase); + + IXLRangeRows FindRows(String search); + IXLRangeRows FindRows(String search, XLSearchContents searchContents); + IXLRangeRows FindRows(String search, XLSearchContents searchContents, Boolean useRegularExpressions); + IXLRangeRows FindRows(String search, XLSearchContents searchContents, Boolean matchCase, Boolean entireCell); + + IXLRangeColumns FindColumns(String search); + IXLRangeColumns FindColumns(String search, XLSearchContents searchContents); + IXLRangeColumns FindColumns(String search, XLSearchContents searchContents, Boolean useRegularExpressions); + IXLRangeColumns FindColumns(String search, XLSearchContents searchContents, Boolean matchCase, Boolean entireCell); + + IXLRange Replace(String oldValue, String newValue); + IXLRange Replace(String oldValue, String newValue, XLSearchContents searchContents); + IXLRange Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeBase.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeBase.cs index cf05e2f..e156d8f 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeBase.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeBase.cs @@ -200,5 +200,9 @@ String ToStringRelative(); String ToStringFixed(); + IXLCells FindCells(String search); + IXLCells FindCells(String search, XLSearchContents searchContents); + IXLCells FindCells(String search, XLSearchContents searchContents, Boolean useRegularExpressions); + IXLCells FindCells(String search, XLSearchContents searchContents, Boolean matchCase, Boolean entireCell); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeColumn.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeColumn.cs index d499fb3..0aeaad4 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeColumn.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeColumn.cs @@ -88,6 +88,10 @@ IXLRangeColumn Sort(Boolean matchCase); IXLRangeColumn Sort(XLSortOrder sortOrder); IXLRangeColumn Sort(XLSortOrder sortOrder, Boolean matchCase); + + IXLRangeColumn Replace(String oldValue, String newValue); + IXLRangeColumn Replace(String oldValue, String newValue, XLSearchContents searchContents); + IXLRangeColumn Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeColumns.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeColumns.cs index 5f36c2c..ff59304 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeColumns.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeColumns.cs @@ -40,5 +40,9 @@ void Delete(); IXLStyle Style { get; set; } + + IXLRangeColumns Replace(String oldValue, String newValue); + IXLRangeColumns Replace(String oldValue, String newValue, XLSearchContents searchContents); + IXLRangeColumns Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeRow.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeRow.cs index f9f9748..5c9a3e2 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeRow.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeRow.cs @@ -95,6 +95,10 @@ IXLRangeRow Sort(Boolean matchCase); IXLRangeRow Sort(XLSortOrder sortOrder); IXLRangeRow Sort(XLSortOrder sortOrder, Boolean matchCase); + + IXLRangeRow Replace(String oldValue, String newValue); + IXLRangeRow Replace(String oldValue, String newValue, XLSearchContents searchContents); + IXLRangeRow Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeRows.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeRows.cs index 8095e0a..341ab6b 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeRows.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRangeRows.cs @@ -39,5 +39,9 @@ void Delete(); IXLStyle Style { get; set; } + + IXLRangeRows Replace(String oldValue, String newValue); + IXLRangeRows Replace(String oldValue, String newValue, XLSearchContents searchContents); + IXLRangeRows Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRanges.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRanges.cs index f5e391b..0506ff6 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRanges.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/IXLRanges.cs @@ -64,5 +64,9 @@ Object Value { set; } IXLRanges SetValue(T value); + + IXLRanges Replace(String oldValue, String newValue); + IXLRanges Replace(String oldValue, String newValue, XLSearchContents searchContents); + IXLRanges Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/Sort/IXLSortElements.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/Sort/IXLSortElements.cs index 8aeff1c..13fc670 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/Sort/IXLSortElements.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/Sort/IXLSortElements.cs @@ -18,5 +18,7 @@ void Add(String elementNumber, XLSortOrder sortOrder, Boolean ignoreBlanks, Boolean matchCase); void Clear(); + + void Remove(Int32 elementNumber); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/Sort/XLSortElements.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/Sort/XLSortElements.cs index 1a42318..52288f4 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/Sort/XLSortElements.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/Sort/XLSortElements.cs @@ -68,5 +68,10 @@ { elements.Clear(); } + + public void Remove(Int32 elementNumber) + { + elements.RemoveAt(elementNumber - 1); + } } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRange.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRange.cs index 7ca48db..996842d 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRange.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRange.cs @@ -959,5 +959,51 @@ lastRowNumber, lastColumnNumber); } + + public IXLRangeColumns FindColumns(String search) + { + return FindColumns(search, XLSearchContents.ValuesAndFormulas); + } + public IXLRangeColumns FindColumns(String search, XLSearchContents searchContents) + { + return FindColumns(search, searchContents, false, false); + } + public IXLRangeColumns FindColumns(String search, XLSearchContents searchContents, Boolean useRegularExpressions) + { + } + public IXLRangeColumns FindColumns(String search, XLSearchContents searchContents, Boolean matchCase, Boolean entireCell) + { + } + + public IXLRangeRows FindRows(String search) + { + return FindRows(search, XLSearchContents.ValuesAndFormulas); + } + public IXLRangeRows FindRows(String search, XLSearchContents searchContents) + { + return FindRows(search, searchContents, false, false); + } + public IXLRangeRows FindRows(String search, XLSearchContents searchContents, Boolean useRegularExpressions) + { + } + public IXLRangeRows FindRows(String search, XLSearchContents searchContents, Boolean matchCase, Boolean entireCell) + { + } + + public new IXLRange Replace(String oldValue, String newValue) + { + base.Replace(oldValue, newValue); + return this; + } + public new IXLRange Replace(String oldValue, String newValue, XLSearchContents searchContents) + { + base.Replace(oldValue, newValue, searchContents); + return this; + } + public new IXLRange Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions) + { + base.Replace(oldValue, newValue, searchContents, useRegularExpressions); + return this; + } } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeBase.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeBase.cs index e4a2b34..6766d38 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeBase.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeBase.cs @@ -1040,5 +1040,33 @@ else Worksheet.AutoFilterRange = null; } + + public IXLCells FindCells(String search) + { + return FindCells(search, XLSearchContents.ValuesAndFormulas); + } + public IXLCells FindCells(String search, XLSearchContents searchContents) + { + return FindCells(search, searchContents, false, false); + } + public IXLCells FindCells(String search, XLSearchContents searchContents, Boolean useRegularExpressions) + { + } + public IXLCells FindCells(String search, XLSearchContents searchContents, Boolean matchCase, Boolean entireCell) + { + } + + public IXLRangeBase Replace(String oldValue, String newValue) + { + return Replace(oldValue, newValue, XLSearchContents.ValuesAndFormulas); + } + public IXLRangeBase Replace(String oldValue, String newValue, XLSearchContents searchContents) + { + return Replace(oldValue, newValue, XLSearchContents.ValuesAndFormulas, false); + } + public IXLRangeBase Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions) + { + + } } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeColumn.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeColumn.cs index 24b336e..c62d0c8 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeColumn.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeColumn.cs @@ -213,6 +213,22 @@ lastColumnNumber) .Column(1); } + + public new IXLRangeColumn Replace(String oldValue, String newValue) + { + base.Replace(oldValue, newValue); + return this; + } + public new IXLRangeColumn Replace(String oldValue, String newValue, XLSearchContents searchContents) + { + base.Replace(oldValue, newValue, searchContents); + return this; + } + public new IXLRangeColumn Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions) + { + base.Replace(oldValue, newValue, searchContents, useRegularExpressions); + return this; + } } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeColumns.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeColumns.cs index 98c79f9..14d8732 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeColumns.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeColumns.cs @@ -133,5 +133,21 @@ return retVal; } } + + public IXLRangeColumns Replace(String oldValue, String newValue) + { + ranges.ForEach(r => r.Replace(oldValue, newValue)); + return this; + } + public IXLRangeColumns Replace(String oldValue, String newValue, XLSearchContents searchContents) + { + ranges.ForEach(r => r.Replace(oldValue, newValue, searchContents)); + return this; + } + public IXLRangeColumns Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions) + { + ranges.ForEach(r => r.Replace(oldValue, newValue, searchContents, useRegularExpressions)); + return this; + } } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeRow.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeRow.cs index fa0a8b6..52b9c2a 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeRow.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeRow.cs @@ -226,6 +226,22 @@ lastColumnNumber) .Row(1); } + + public new IXLRangeRow Replace(String oldValue, String newValue) + { + base.Replace(oldValue, newValue); + return this; + } + public new IXLRangeRow Replace(String oldValue, String newValue, XLSearchContents searchContents) + { + base.Replace(oldValue, newValue, searchContents); + return this; + } + public new IXLRangeRow Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions) + { + base.Replace(oldValue, newValue, searchContents, useRegularExpressions); + return this; + } } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeRows.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeRows.cs index 61c8808..70338b4 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeRows.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRangeRows.cs @@ -132,5 +132,21 @@ return retVal; } } + + public IXLRangeRows Replace(String oldValue, String newValue) + { + ranges.ForEach(r => r.Replace(oldValue, newValue)); + return this; + } + public IXLRangeRows Replace(String oldValue, String newValue, XLSearchContents searchContents) + { + ranges.ForEach(r => r.Replace(oldValue, newValue, searchContents)); + return this; + } + public IXLRangeRows Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions) + { + ranges.ForEach(r => r.Replace(oldValue, newValue, searchContents, useRegularExpressions)); + return this; + } } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRanges.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRanges.cs index 6b9677f..fb0c7f3 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRanges.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Ranges/XLRanges.cs @@ -223,5 +223,21 @@ return this; } } + + public IXLRanges Replace(String oldValue, String newValue) + { + ranges.ForEach(r => r.Replace(oldValue, newValue)); + return this; + } + public IXLRanges Replace(String oldValue, String newValue, XLSearchContents searchContents) + { + ranges.ForEach(r => r.Replace(oldValue, newValue, searchContents)); + return this; + } + public IXLRanges Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions) + { + ranges.ForEach(r => r.Replace(oldValue, newValue, searchContents, useRegularExpressions)); + return this; + } } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/IXLRow.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/IXLRow.cs index e918382..d90866e 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/IXLRow.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/IXLRow.cs @@ -164,5 +164,8 @@ IXLRangeRow Row(Int32 start, Int32 end); + IXLRow Replace(String oldValue, String newValue); + IXLRow Replace(String oldValue, String newValue, XLSearchContents searchContents); + IXLRow Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/IXLRows.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/IXLRows.cs index 1cc3f03..3bb21b6 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/IXLRows.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/IXLRows.cs @@ -104,5 +104,9 @@ IXLCells CellsUsed(Boolean includeStyles); IXLStyle Style { get; set; } + + IXLRows Replace(String oldValue, String newValue); + IXLRows Replace(String oldValue, String newValue, XLSearchContents searchContents); + IXLRows Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/XLRow.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/XLRow.cs index 072ea7b..8dd0417 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/XLRow.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/XLRow.cs @@ -581,5 +581,21 @@ { return this.AsRange().Range(1, start, 1, end).Row(1); } + + public new IXLRow Replace(String oldValue, String newValue) + { + base.Replace(oldValue, newValue); + return this; + } + public new IXLRow Replace(String oldValue, String newValue, XLSearchContents searchContents) + { + base.Replace(oldValue, newValue, searchContents); + return this; + } + public new IXLRow Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions) + { + base.Replace(oldValue, newValue, searchContents, useRegularExpressions); + return this; + } } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/XLRows.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/XLRows.cs index 66d6d1e..55614f4 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/XLRows.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Rows/XLRows.cs @@ -247,5 +247,21 @@ return retVal; } } + + public IXLRows Replace(String oldValue, String newValue) + { + rows.ForEach(r => r.Replace(oldValue, newValue)); + return this; + } + public IXLRows Replace(String oldValue, String newValue, XLSearchContents searchContents) + { + rows.ForEach(r => r.Replace(oldValue, newValue, searchContents)); + return this; + } + public IXLRows Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions) + { + rows.ForEach(r => r.Replace(oldValue, newValue, searchContents, useRegularExpressions)); + return this; + } } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Tables/IXLTable.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Tables/IXLTable.cs index 0d8f3e3..8b8568f 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Tables/IXLTable.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Tables/IXLTable.cs @@ -304,5 +304,14 @@ IXLSortElements SortRows { get; } IXLSortElements SortColumns { get; } + + IXLTableRows FindRows(String search); + IXLTableRows FindRows(String search, XLSearchContents searchContents); + IXLTableRows FindRows(String search, XLSearchContents searchContents, Boolean useRegularExpressions); + IXLTableRows FindRows(String search, XLSearchContents searchContents, Boolean matchCase, Boolean entireCell); + + IXLTable Replace(String oldValue, String newValue); + IXLTable Replace(String oldValue, String newValue, XLSearchContents searchContents); + IXLTable Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Tables/IXLTableRow.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Tables/IXLTableRow.cs index ee747c3..6a71358 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Tables/IXLTableRow.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Tables/IXLTableRow.cs @@ -14,5 +14,9 @@ new IXLTableRow Sort(Boolean matchCase); new IXLTableRow Sort(XLSortOrder sortOrder); new IXLTableRow Sort(XLSortOrder sortOrder, Boolean matchCase); + + new IXLTableRow Replace(String oldValue, String newValue); + new IXLTableRow Replace(String oldValue, String newValue, XLSearchContents searchContents); + new IXLTableRow Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Tables/IXLTableRows.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Tables/IXLTableRows.cs index da52ae3..a2ad34f 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Tables/IXLTableRows.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Tables/IXLTableRows.cs @@ -35,5 +35,9 @@ IXLCells CellsUsed(Boolean includeStyles); IXLStyle Style { get; set; } + + IXLTableRows Replace(String oldValue, String newValue); + IXLTableRows Replace(String oldValue, String newValue, XLSearchContents searchContents); + IXLTableRows Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions); } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Tables/XLTable.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Tables/XLTable.cs index 645f178..a72b43f 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Tables/XLTable.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Tables/XLTable.cs @@ -349,5 +349,36 @@ } return DataRange.Sort(toSortBy.ToString(0, toSortBy.Length - 1)); } + + public new IXLTableRows FindRows(String search) + { + return FindRows(search, XLSearchContents.ValuesAndFormulas); + } + public new IXLTableRows FindRows(String search, XLSearchContents searchContents) + { + return FindRows(search, searchContents, false, false); + } + public new IXLTableRows FindRows(String search, XLSearchContents searchContents, Boolean useRegularExpressions) + { + } + public new IXLTableRows FindRows(String search, XLSearchContents searchContents, Boolean matchCase, Boolean entireCell) + { + } + + public new IXLTable Replace(String oldValue, String newValue) + { + base.Replace(oldValue, newValue); + return this; + } + public new IXLTable Replace(String oldValue, String newValue, XLSearchContents searchContents) + { + base.Replace(oldValue, newValue, searchContents); + return this; + } + public new IXLTable Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions) + { + base.Replace(oldValue, newValue, searchContents, useRegularExpressions); + return this; + } } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Tables/XLTableRow.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Tables/XLTableRow.cs index 06f123a..643ae8d 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Tables/XLTableRow.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Tables/XLTableRow.cs @@ -45,5 +45,21 @@ this.AsRange().Sort(XLSortOrientation.LeftToRight, sortOrder, matchCase); return this; } + + public new IXLTableRow Replace(String oldValue, String newValue) + { + base.Replace(oldValue, newValue); + return this; + } + public new IXLTableRow Replace(String oldValue, String newValue, XLSearchContents searchContents) + { + base.Replace(oldValue, newValue, searchContents); + return this; + } + public new IXLTableRow Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions) + { + base.Replace(oldValue, newValue, searchContents, useRegularExpressions); + return this; + } } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Tables/XLTableRows.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Tables/XLTableRows.cs index 3e4c0b0..2df9cee 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Tables/XLTableRows.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Tables/XLTableRows.cs @@ -126,5 +126,21 @@ return retVal; } } + + public IXLTableRows Replace(String oldValue, String newValue) + { + ranges.ForEach(r => r.Replace(oldValue, newValue)); + return this; + } + public IXLTableRows Replace(String oldValue, String newValue, XLSearchContents searchContents) + { + ranges.ForEach(r => r.Replace(oldValue, newValue, searchContents)); + return this; + } + public IXLTableRows Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions) + { + ranges.ForEach(r => r.Replace(oldValue, newValue, searchContents, useRegularExpressions)); + return this; + } } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/XLWorkbook.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/XLWorkbook.cs index b50a15a..bad8610 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/XLWorkbook.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/XLWorkbook.cs @@ -399,5 +399,21 @@ } public IXLCustomProperties CustomProperties { get; private set; } + + public XLWorkbook Replace(String oldValue, String newValue) + { + Worksheets.Replace(oldValue, newValue); + return this; + } + public XLWorkbook Replace(String oldValue, String newValue, XLSearchContents searchContents) + { + Worksheets.Replace(oldValue, newValue, searchContents); + return this; + } + public XLWorkbook Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions) + { + Worksheets.Replace(oldValue, newValue, searchContents, useRegularExpressions); + return this; + } } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/XLWorkbook_Save.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/XLWorkbook_Save.cs index 19ec97e..c45b33e 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/XLWorkbook_Save.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/XLWorkbook_Save.cs @@ -419,8 +419,11 @@ GenerateWorksheetPartContent(worksheetPart, worksheet); + + //DrawingsPart drawingsPart = worksheetPart.AddNewPart(relId.GetNext(RelType.Workbook)); + //GenerateDrawingsPartContent(drawingsPart); } - + GenerateCalculationChainPartContent(workbookPart); @@ -3348,5 +3351,102 @@ tableDefinitionPart.Table = table; } + + /* + // Generates content of drawingsPart1. + private void GenerateDrawingsPartContent(DrawingsPart drawingsPart, XLWorksheet worksheet) + { + if (drawingsPart.WorksheetDrawing == null) + drawingsPart.WorksheetDrawing = new Xdr.WorksheetDrawing(); + + var worksheetDrawing = drawingsPart.WorksheetDrawing; + + if (!worksheetDrawing.NamespaceDeclarations.Contains(new KeyValuePair("xdr", "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"))) + worksheetDrawing.AddNamespaceDeclaration("xdr", "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"); + if (!worksheetDrawing.NamespaceDeclarations.Contains(new KeyValuePair("a", "http://schemas.openxmlformats.org/drawingml/2006/main"))) + worksheetDrawing.AddNamespaceDeclaration("a", "http://schemas.openxmlformats.org/drawingml/2006/main"); + + foreach (var chart in worksheet.Charts.OrderBy(c=>c.Position.ZOrder).Select(c=>c)) + { + Xdr.TwoCellAnchor twoCellAnchor = new Xdr.TwoCellAnchor(); + twoCellAnchor. + } + + + + Xdr.FromMarker fromMarker1 = new Xdr.FromMarker(); + Xdr.ColumnId columnId1 = new Xdr.ColumnId(); + columnId1.Text = "3"; + Xdr.ColumnOffset columnOffset1 = new Xdr.ColumnOffset(); + columnOffset1.Text = "152400"; + Xdr.RowId rowId1 = new Xdr.RowId(); + rowId1.Text = "0"; + Xdr.RowOffset rowOffset1 = new Xdr.RowOffset(); + rowOffset1.Text = "133350"; + + fromMarker1.Append(columnId1); + fromMarker1.Append(columnOffset1); + fromMarker1.Append(rowId1); + fromMarker1.Append(rowOffset1); + + Xdr.ToMarker toMarker1 = new Xdr.ToMarker(); + Xdr.ColumnId columnId2 = new Xdr.ColumnId(); + columnId2.Text = "10"; + Xdr.ColumnOffset columnOffset2 = new Xdr.ColumnOffset(); + columnOffset2.Text = "457200"; + Xdr.RowId rowId2 = new Xdr.RowId(); + rowId2.Text = "15"; + Xdr.RowOffset rowOffset2 = new Xdr.RowOffset(); + rowOffset2.Text = "19050"; + + toMarker1.Append(columnId2); + toMarker1.Append(columnOffset2); + toMarker1.Append(rowId2); + toMarker1.Append(rowOffset2); + + Xdr.GraphicFrame graphicFrame1 = new Xdr.GraphicFrame() { Macro = "" }; + + Xdr.NonVisualGraphicFrameProperties nonVisualGraphicFrameProperties1 = new Xdr.NonVisualGraphicFrameProperties(); + Xdr.NonVisualDrawingProperties nonVisualDrawingProperties1 = new Xdr.NonVisualDrawingProperties() { Id = (UInt32Value)5U, Name = "Chart 4" }; + Xdr.NonVisualGraphicFrameDrawingProperties nonVisualGraphicFrameDrawingProperties1 = new Xdr.NonVisualGraphicFrameDrawingProperties(); + + nonVisualGraphicFrameProperties1.Append(nonVisualDrawingProperties1); + nonVisualGraphicFrameProperties1.Append(nonVisualGraphicFrameDrawingProperties1); + + Xdr.Transform transform1 = new Xdr.Transform(); + A.Offset offset1 = new A.Offset() { X = 0L, Y = 0L }; + A.Extents extents1 = new A.Extents() { Cx = 0L, Cy = 0L }; + + transform1.Append(offset1); + transform1.Append(extents1); + + A.Graphic graphic1 = new A.Graphic(); + + A.GraphicData graphicData1 = new A.GraphicData() { Uri = "http://schemas.openxmlformats.org/drawingml/2006/chart" }; + + C.ChartReference chartReference1 = new C.ChartReference() { Id = "rId1" }; + chartReference1.AddNamespaceDeclaration("c", "http://schemas.openxmlformats.org/drawingml/2006/chart"); + chartReference1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"); + + graphicData1.Append(chartReference1); + + graphic1.Append(graphicData1); + + graphicFrame1.Append(nonVisualGraphicFrameProperties1); + graphicFrame1.Append(transform1); + graphicFrame1.Append(graphic1); + Xdr.ClientData clientData1 = new Xdr.ClientData(); + + twoCellAnchor1.Append(fromMarker1); + twoCellAnchor1.Append(toMarker1); + twoCellAnchor1.Append(graphicFrame1); + twoCellAnchor1.Append(clientData1); + + worksheetDrawing1.Append(twoCellAnchor1); + + drawingsPart1.WorksheetDrawing = worksheetDrawing1; + + } + */ } } \ No newline at end of file diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/XLWorksheet.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/XLWorksheet.cs index 1c957b6..49b39e6 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/XLWorksheet.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/XLWorksheet.cs @@ -44,6 +44,7 @@ this.Name = sheetName; RangeShiftedRows += new RangeShiftedRowsDelegate(XLWorksheet_RangeShiftedRows); RangeShiftedColumns += new RangeShiftedColumnsDelegate(XLWorksheet_RangeShiftedColumns); + Charts = new XLCharts(); } void XLWorksheet_RangeShiftedColumns(XLRange range, int columnsShifted) @@ -807,5 +808,53 @@ SortRows.ForEach(e => range.SortRows.Add(e.ElementNumber, e.SortOrder, e.IgnoreBlanks, e.MatchCase)); return range; } + + public IXLCharts Charts { get; private set; } + + public IXLColumns FindColumns(String search) + { + return FindColumns(search, XLSearchContents.ValuesAndFormulas); + } + public IXLColumns FindColumns(String search, XLSearchContents searchContents) + { + return FindColumns(search, searchContents, false, false); + } + public IXLColumns FindColumns(String search, XLSearchContents searchContents, Boolean useRegularExpressions) + { + } + public IXLColumns FindColumns(String search, XLSearchContents searchContents, Boolean matchCase, Boolean entireCell) + { + } + + public IXLRows FindRows(String search) + { + return FindRows(search, XLSearchContents.ValuesAndFormulas); + } + public IXLRows FindRows(String search, XLSearchContents searchContents) + { + return FindRows(search, searchContents, false, false); + } + public IXLRows FindRows(String search, XLSearchContents searchContents, Boolean useRegularExpressions) + { + } + public IXLRows FindRows(String search, XLSearchContents searchContents, Boolean matchCase, Boolean entireCell) + { + } + + public new IXLWorksheet Replace(String oldValue, String newValue) + { + base.Replace(oldValue, newValue); + return this; + } + public new IXLWorksheet Replace(String oldValue, String newValue, XLSearchContents searchContents) + { + base.Replace(oldValue, newValue, searchContents); + return this; + } + public new IXLWorksheet Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions) + { + base.Replace(oldValue, newValue, searchContents, useRegularExpressions); + return this; + } } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/XLWorksheets.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/XLWorksheets.cs index 48dbb6b..168ee95 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/XLWorksheets.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/XLWorksheets.cs @@ -104,6 +104,20 @@ #endregion - + public IXLWorksheets Replace(String oldValue, String newValue) + { + worksheets.Values.ForEach(r => r.Replace(oldValue, newValue)); + return this; + } + public IXLWorksheets Replace(String oldValue, String newValue, XLSearchContents searchContents) + { + worksheets.Values.ForEach(r => r.Replace(oldValue, newValue, searchContents)); + return this; + } + public IXLWorksheets Replace(String oldValue, String newValue, XLSearchContents searchContents, Boolean useRegularExpressions) + { + worksheets.Values.ForEach(r => r.Replace(oldValue, newValue, searchContents, useRegularExpressions)); + return this; + } } } diff --git a/ClosedXML/ClosedXML/ClosedXML_Examples/Ranges/SortExample.cs b/ClosedXML/ClosedXML/ClosedXML_Examples/Ranges/SortExample.cs index 6d8a388..043601a 100644 --- a/ClosedXML/ClosedXML/ClosedXML_Examples/Ranges/SortExample.cs +++ b/ClosedXML/ClosedXML/ClosedXML_Examples/Ranges/SortExample.cs @@ -62,7 +62,9 @@ table.Sort("Column2, Column3 Desc, Column1 ASC"); wsTable.Row(1).InsertRowsAbove(2); - wsTable.Cell(1, 1).SetValue(".Sort(\"Column2, Column3 Desc, Column1 ASC\") = Sort table Top to Bottom, Col 2 Asc, Col 3 Desc, Col 1 Asc, Ignore Blanks, Ignore Case").Style.Font.SetBold(); + wsTable.Cell(1, 1) + .SetValue(".Sort(\"Column2, Column3 Desc, Column1 ASC\") = Sort table Top to Bottom, Col 2 Asc, Col 3 Desc, Col 1 Asc, Ignore Blanks, Ignore Case") + .Style.Font.SetBold(); #endregion #region Sort a simple range left to right @@ -75,7 +77,9 @@ copyLeftToRight.Sort(XLSortOrientation.LeftToRight); wsLeftToRight.Row(1).InsertRowsAbove(2); - wsLeftToRight.Cell(1, 1).SetValue(".Sort(XLSortOrientation.LeftToRight) = Sort Range Left to Right, Ascendingly, Ignore Blanks, Ignore Case").Style.Font.SetBold(); + wsLeftToRight.Cell(1, 1) + .SetValue(".Sort(XLSortOrientation.LeftToRight) = Sort Range Left to Right, Ascendingly, Ignore Blanks, Ignore Case") + .Style.Font.SetBold(); #endregion #region Sort a range diff --git a/ClosedXML/ClosedXML/ClosedXML_Net3.5/ClosedXML_Net3.5.csproj b/ClosedXML/ClosedXML/ClosedXML_Net3.5/ClosedXML_Net3.5.csproj index 2b15d01..853c47e 100644 --- a/ClosedXML/ClosedXML/ClosedXML_Net3.5/ClosedXML_Net3.5.csproj +++ b/ClosedXML/ClosedXML/ClosedXML_Net3.5/ClosedXML_Net3.5.csproj @@ -130,6 +130,24 @@ Excel\Cells\XLCells.cs + + Excel\Charts\IXLChart.cs + + + Excel\Charts\IXLCharts.cs + + + Excel\Charts\IXLDrawingPosition.cs + + + Excel\Charts\XLChart.cs + + + Excel\Charts\XLCharts.cs + + + Excel\Charts\XLDrawingPosition.cs + Excel\Columns\IXLColumn.cs diff --git a/ClosedXML/ClosedXML/ClosedXML_Sandbox/Program.cs b/ClosedXML/ClosedXML/ClosedXML_Sandbox/Program.cs index 64d1a66..cface98 100644 --- a/ClosedXML/ClosedXML/ClosedXML_Sandbox/Program.cs +++ b/ClosedXML/ClosedXML/ClosedXML_Sandbox/Program.cs @@ -20,8 +20,12 @@ //var wb = new XLWorkbook(String.Format(@"c:\Excel Files\ForTesting\{0}.xlsx", fileName)); var wb = new XLWorkbook(); var ws = wb.Worksheets.Add("Sheet1"); - ws.Row(5).Height = 50; - ws.Row(2).InsertRowsAbove(1); + ws.Cell("A1").Value = "Category"; + ws.Cell("A2").Value = "A"; + ws.Cell("A3").Value = "B"; + ws.Cell("B1").Value = "Value"; + ws.Cell("B2").Value = 5; + ws.Cell("B3").Value = 10; wb.SaveAs(String.Format(@"c:\Excel Files\ForTesting\{0}_Saved.xlsx", fileName)); }