diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/IXLRange.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/IXLRange.cs index a7c3728..ee30786 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/IXLRange.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/IXLRange.cs @@ -68,6 +68,10 @@ return range.LastCellAddress.Column - range.FirstCellAddress.Column + 1; } + public static IXLRange Range(this IXLRange range, Int32 firstCellRow, Int32 firstCellColumn, Int32 lastCellRow, Int32 lastCellColumn) + { + return range.Range(new XLAddress(firstCellRow, firstCellColumn), new XLAddress(lastCellRow, lastCellColumn)); + } public static IXLRange Range(this IXLRange range, String rangeAddress) { String[] arrRange = rangeAddress.Split(':'); @@ -251,6 +255,8 @@ } return retVal; } + + } } diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/IXLWorksheet.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/IXLWorksheet.cs index fdfe9e9..5bccab0 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/IXLWorksheet.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/IXLWorksheet.cs @@ -9,13 +9,19 @@ { Dictionary ColumnsCollection { get; } Dictionary RowsCollection { get; } - new IXLRow Row(Int32 column); new IXLColumn Column(Int32 column); new IXLColumn Column(String column); - String Name { get; set; } - List Columns(); + + void SetPrintArea(IXLRange range); + void SetPrintArea(String rangeAddress); + void SetPrintArea(IXLCell firstCell, IXLCell lastCell); + void SetPrintArea(String firstCellAddress, String lastCellAddress); + void SetPrintArea(IXLAddress firstCellAddress, IXLAddress lastCellAddress); + void SetPrintArea(Int32 firstCellRow, Int32 firstCellColumn, Int32 lastCellRow, Int32 lastCellColumn); + + } } diff --git a/ClosedXML/ClosedXML/ClosedXML_Sandbox/Program.cs b/ClosedXML/ClosedXML/ClosedXML_Sandbox/Program.cs index 2e66faa..1e6e05b 100644 --- a/ClosedXML/ClosedXML/ClosedXML_Sandbox/Program.cs +++ b/ClosedXML/ClosedXML/ClosedXML_Sandbox/Program.cs @@ -15,17 +15,19 @@ var wb = new XLWorkbook(); var ws = wb.Worksheets.Add("New Sheet"); - foreach (var c in ws.Range("B2:C3").Columns()) - { - c.Style.Fill.BackgroundColor = Color.Red; - } - ws.Cell("E1").Value = "Wide 2"; - foreach (var c in ws.Columns()) - { - c.Width = 20; - } + //foreach (var c in ws.Range("B2:C3").Columns()) + //{ + // c.Style.Fill.BackgroundColor = Color.Red; + //} + + //ws.Cell("E1").Value = "Wide 2"; + + //foreach (var c in ws.Columns()) + //{ + // c.Width = 20; + //} // Fix Worksheet.Cells() method !!!