Class ExcelRangeBase¶
Namespace: OfficeOpenXml
Assembly: EPPlus.dll
A range of cells
public class ExcelRangeBase : ExcelAddress, IEnumerable<ExcelRangeBase>, IEnumerable, IEnumerator<ExcelRangeBase>, IDisposable, IEnumerator
Inheritance¶
object ← ExcelCellBase ← ExcelAddressBase ← ExcelAddress ← ExcelRangeBase
Derived¶
Implements¶
IDisposable
IEnumerable
IEnumerable<ExcelRangeBase>
IEnumerator
IEnumerator<ExcelRangeBase>
Inherited Members¶
ExcelAddress.Address
ExcelAddressBase.Address
ExcelAddressBase.AddressAbsolute
ExcelAddressBase.BeforeChangeAddress(string)
ExcelAddressBase.ChangeAddress(string)
ExcelAddressBase.Columns
ExcelAddressBase.End
ExcelAddressBase.Equals(object)
ExcelAddressBase.ExternalReferenceIndex
ExcelAddressBase.FullAddress
ExcelAddressBase.GetHashCode()
ExcelAddressBase.IsExternal
ExcelAddressBase.IsFullColumn
ExcelAddressBase.IsFullRow
ExcelAddressBase.IsName
ExcelAddressBase.LocalAddress
ExcelAddressBase.Rows
ExcelAddressBase.SetAddress(string, ExcelWorkbook, string)
ExcelAddressBase.Start
ExcelAddressBase.Table
ExcelAddressBase.ToString()
ExcelAddressBase.Validate()
ExcelCellBase.GetAddress(int, bool, int, bool)
ExcelCellBase.GetAddress(int, int, bool)
ExcelCellBase.GetAddress(int, int, int, int, bool, bool, bool, bool)
ExcelCellBase.GetAddress(int, int, int, int, bool)
ExcelCellBase.GetAddress(int, int, int, int)
ExcelCellBase.GetAddress(int, int)
ExcelCellBase.GetAddressCol(int, bool)
ExcelCellBase.GetAddressRow(int, bool)
ExcelCellBase.GetColumnLetter(int, bool)
ExcelCellBase.GetColumnLetter(int)
ExcelCellBase.GetFullAddress(string, string, string)
ExcelCellBase.GetFullAddress(string, string)
ExcelCellBase.IsSimpleAddress(string)
ExcelCellBase.IsValidAddress(string)
ExcelCellBase.IsValidCellAddress(string)
ExcelCellBase.IsValidRangeAddress(string)
ExcelCellBase.IsValidTableAddress(string)
ExcelCellBase.TranslateFromR1C1(string, int, int)
ExcelCellBase.TranslateToR1C1(string, int, int)
object.Equals(object?, object?)
object.Equals(object?)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object?, object?)
object.ToString()
Extension Methods¶
CalculationExtension.Calculate(ExcelRangeBase, Action<ExcelCalculationOption>)
CalculationExtension.Calculate(ExcelRangeBase, ExcelCalculationOption)
CalculationExtension.Calculate(ExcelRangeBase)
RangeExtensions.SkipColumns(ExcelRangeBase, int)
RangeExtensions.SkipRows(ExcelRangeBase, int)
RangeExtensions.TakeColumns(ExcelRangeBase, int)
RangeExtensions.TakeColumnsBetween(ExcelRangeBase, int, int)
RangeExtensions.TakeRows(ExcelRangeBase, int)
RangeExtensions.TakeRowsBetween(ExcelRangeBase, int, int)
RangeExtensions.TakeSingleCell(ExcelRangeBase, int, int)
RangeExtensions.TakeSingleColumn(ExcelRangeBase, int)
RangeExtensions.TakeSingleRow(ExcelRangeBase, int)
Fields¶
_rtc¶
The richtext collection
Field Value¶
_worksheet¶
Reference to the worksheet
Field Value¶
Properties¶
AutoFilter¶
Set an autofilter for the range
Property Value¶
Comment¶
Returns the comment object of the first cell in the range
Property Value¶
ConditionalFormatting¶
Conditional Formatting for this range.
Property Value¶
Current¶
The current range when enumerating
Property Value¶
DataValidation¶
Data validation for this range.
Property Value¶
EntireColumn¶
A reference to the column properties for column(s= referenced by this range. If multiple ranges are addressed (e.g a1:a2,c1:c3), only the first address is used.
Property Value¶
EntireRow¶
A reference to the row properties for row(s) referenced by this range. If multiple ranges are addressed (e.g a1:a2,c1:c3), only the first address is used.
Property Value¶
Formula¶
Gets or sets a formula for a range.
Property Value¶
FormulaR1C1¶
Gets or Set a formula in R1C1 format.
Property Value¶
FormulaRange¶
The output range of the formula in the top-left cell of the range. A shared formula will return the range for the entire series. An array formula will return the range of the output of the formula. If you want the range of a dynamic array formula, you must calculate the formula first.
Property Value¶
FullAddress¶
Address including sheet name
Property Value¶
FullAddressAbsolute¶
Address including sheetname
Property Value¶
Hyperlink¶
Set the Hyperlink property for a range of cells
Property Value¶
Uri
IsArrayFormula¶
Is the range a part of an Arrayformula
Property Value¶
IsRichText¶
If the value is in richtext format.
Property Value¶
IsTable¶
Returns true if the range is a table. If the range partly matches a table range false will be returned. IsTable
Property Value¶
Merge¶
If the cells in the range are merged.
Property Value¶
Picture¶
Used to add/remove cell pictures in the range
Property Value¶
RichText¶
The cell value is rich text formatted. The RichText-property only apply to the left-top cell of the range.
Property Value¶
Style¶
The style object for the range.
Property Value¶
StyleID¶
The style ID. It is not recomended to use this one. Use Named styles as an alternative. If you do, make sure that you use the Style.UpdateXml() method to update any new styles added to the workbook.
Property Value¶
StyleName¶
The named style
Property Value¶
Text¶
Returns the formatted value.
Property Value¶
ThreadedComment¶
Returns the threaded comment object of the first cell in the range
Property Value¶
UseImplicitItersection¶
If the formula in the single cell returns an array, implicit intersection will be used instead of creating a dynamic array formula. Please note that this property must be set after setting the formula, as default behaviour is to create a dynamic array formula. Shared formulas will always use implicit intersection.
Property Value¶
Value¶
Set the range to a specific value
Property Value¶
Worksheet¶
WorkSheet object
Property Value¶
Methods¶
AddComment(string, string)¶
Adds a new comment for the range. If this range contains more than one cell, the top left comment is returned by the method.
Parameters¶
Text string
The text for the comment
Author string
The author for the comment. If this property is null or blank EPPlus will set it to the identity of the ClaimsPrincipal if available otherwise to "Anonymous"
Returns¶
A reference comment of the top left cell
AddThreadedComment()¶
Adds a new threaded comment for the range. If this range contains more than one cell, the top left comment is returned by the method.
Returns¶
A reference comment of the top left cell
AutoFitColumns()¶
Set the column width from the content of the range. Columns outside of the worksheets dimension are ignored. The minimum width is the value of the ExcelWorksheet.defaultColumnWidth property.
Remarks¶
Cells containing formulas must be calculated before autofit is called. Wrapped and merged cells are also ignored.
AutoFitColumns(double)¶
Set the column width from the content of the range. Columns outside of the worksheets dimension are ignored.
Parameters¶
MinimumWidth double
Minimum column width
Remarks¶
This method will not work if you run in an environment that does not support GDI. Cells containing formulas are ignored if no calculation is made. Wrapped and merged cells are also ignored.
AutoFitColumns(double, double)¶
Set the column width from the content of the range. Columns outside of the worksheets dimension are ignored.
Parameters¶
MinimumWidth double
Minimum column width
MaximumWidth double
Maximum column width
Remarks¶
This method will not work if you run in an environment that does not support GDI. Cells containing formulas are ignored if no calculation is made. Wrapped and merged cells are also ignored.
ChangeAddress(string)¶
On change address handler
Parameters¶
value string
Clear()¶
Clear all cells
ClearFormulaValues()¶
Removes all values of cells with formulas, but keeps the formulas.
ClearFormulas()¶
Removes all formulas within the range, but keeps the calculated values.
Copy(ExcelRangeBase)¶
Copies the range of cells to another range.
Parameters¶
Destination ExcelRangeBase
The top-left cell where the range will be copied.
Copy(ExcelRangeBase, ExcelRangeCopyOptionFlags?)¶
Copies the range of cells to an other range
Parameters¶
Destination ExcelRangeBase
The start cell where the range will be copied.
excelRangeCopyOptionFlags ExcelRangeCopyOptionFlags?
Options for copying.
Copy(ExcelRangeBase, params ExcelRangeCopyOptionFlags[])¶
Copies the range of cells to an other range
public void Copy(ExcelRangeBase Destination, params ExcelRangeCopyOptionFlags[] excelRangeCopyOptionFlags)
Parameters¶
Destination ExcelRangeBase
The start cell where the range will be copied.
excelRangeCopyOptionFlags ExcelRangeCopyOptionFlags[]
Options for copying.
Copy(ExcelRangeBase, ExcelRangeCopyOnly)¶
Copy only the properties specified
Parameters¶
Destination ExcelRangeBase
flag ExcelRangeCopyOnly
CopyFill(ExcelRangeBase)¶
Copies the range of cells to another range of cells. The desination ranges rows and columns needs to be a multiple of the source's ranges rows and columns.
Parameters¶
Destination ExcelRangeBase
The range of cells to copy into.
CopyFill(ExcelRangeBase, params ExcelRangeCopyOptionFlags[])¶
Copies the range of cells to another range of cells. The desination ranges rows and columns needs to be a multiple of the source's ranges rows and columns.
public void CopyFill(ExcelRangeBase Destination, params ExcelRangeCopyOptionFlags[] excelRangeCopyOptionFlags)
Parameters¶
Destination ExcelRangeBase
The range of cells to copy into.
excelRangeCopyOptionFlags ExcelRangeCopyOptionFlags[]
Options for copying. Fill property will be set.
CopyFormulas(ExcelRangeBase)¶
Copy formulas from source range to destination range. Note: Like Excel "Paste Special", also copies underlying cell values.
Parameters¶
Destination ExcelRangeBase
CopyFormulas(ExcelRangeBase, ExcelRangeCopyOperations)¶
Copy only formulas from source range to destination range. Note: Like Excel "Paste Special", also copies underlying cell values.
public void CopyFormulas(ExcelRangeBase Destination, ExcelRangeCopyOperations fillOrTranspose = (ExcelRangeCopyOperations)0)
Parameters¶
Destination ExcelRangeBase
fillOrTranspose ExcelRangeCopyOperations
Fill or transpose options
CopyStyles(ExcelRangeBase)¶
Copy the styles from the source range to the destination range. If the destination range is larger than the source range, the styles of the column to the right and the row at the bottom will be expanded to the destination.
Parameters¶
Destination ExcelRangeBase
The destination range
CopyTranspose(ExcelRangeBase)¶
Copies the range of cells to another range of cells transposed.
Parameters¶
Destination ExcelRangeBase
The range of cells to copy into.
CopyTranspose(ExcelRangeBase, params ExcelRangeCopyOptionFlags[])¶
Copies the range of cells to another range of cells transposed.
public void CopyTranspose(ExcelRangeBase Destination, params ExcelRangeCopyOptionFlags[] excelRangeCopyOptionFlags)
Parameters¶
Destination ExcelRangeBase
The range of cells to copy into.
excelRangeCopyOptionFlags ExcelRangeCopyOptionFlags[]
Options for copying. Transpose property will be set.
CopyValues(ExcelRangeBase)¶
Copy only cell values from source range to destination range.
Parameters¶
Destination ExcelRangeBase
CopyValues(ExcelRangeBase, ExcelRangeCopyOperations)¶
Copy only cell values from source range to destination range.
public void CopyValues(ExcelRangeBase Destination, ExcelRangeCopyOperations fillOrTranspose = (ExcelRangeCopyOperations)0)
Parameters¶
Destination ExcelRangeBase
fillOrTranspose ExcelRangeCopyOperations
Fill or transpose options
CreateArrayFormula(string, bool)¶
Creates an array-formula.
Parameters¶
ArrayFormula string
The formula
isDynamic bool
If the array formula is dynamic. Setting this argument to true will only add the dynamic array formula cell meta data flag to the formula. If you calculate the formula it is not be necessary to set this flag. If you set this flag, you are responsible to set the correct range for the dynamic array formula, so in most cases calculating is a better approach. If you calculate the formula this flag will be overwritten with the value the EPPlus decides for the formula. Also see Calculate(ExcelWorkbook), Calculate(ExcelWorksheet), Calculate(ExcelRangeBase)
CreateHtmlExporter()¶
Creates an IExcelHtmlRangeExporter for html export of this range.
Returns¶
A html exporter
Delete(eShiftTypeDelete)¶
Delete the range from the worksheet and shift affected cells in the selected direction.
Parameters¶
shift eShiftTypeDelete
The direction that the cells will shift.
Dispose()¶
Disposes the object
FillDateTime()¶
Fills the range by adding 1 day to each cell starting from the value in the top left cell by column.
FillDateTime(DateTime?, eDateTimeUnit, int)¶
Fills the range by adding 1 day to each cell per column starting from startValue.
public void FillDateTime(DateTime? startValue, eDateTimeUnit dateTimeUnit = eDateTimeUnit.Day, int stepValue = 1)
Parameters¶
startValue DateTime?
dateTimeUnit eDateTimeUnit
stepValue int
FillDateTime(Action<FillDateParams>)¶
Fill the range with dates.
Parameters¶
options Action<FillDateParams>
Options how to perform the fill
FillList<T>(IEnumerable<T>)¶
Fills the range columnwise (Down) using the values in the list.
Parameters¶
list IEnumerable<T>
The list to use.
Type Parameters¶
T
Type used in the list.
FillList<T>(IEnumerable<T>, Action<FillListParams>)¶
Parameters¶
list IEnumerable<T>
options Action<FillListParams>
Type Parameters¶
T
FillNumber()¶
Fills the range by adding 1 to each cell starting from the value in the top left cell by column
FillNumber(double?, double)¶
Fills a range by adding the step value to the start Value. If startValue is null the first value in the row/column is used.
Fill is done by column from top to bottom
Parameters¶
startValue double?
The start value of the first cell. If this value is null the value of the first cell is used.
stepValue double
The value used for each step
FillNumber(Action<FillNumberParams>)¶
Fills a range by using the argument options.
Parameters¶
options Action<FillNumberParams>
The option to configure the fill.
GetCellValue<T>()¶
Gets the typed value of a cell
Returns¶
T
The value of the cell
Type Parameters¶
T
The returned type
GetCellValue<T>(int)¶
Gets the value of a cell using an offset from the top-left cell in the range.
Parameters¶
columnOffset int
Column offset from the top-left cell in the range
Returns¶
T
Type Parameters¶
T
The returned type
GetCellValue<T>(int, int)¶
Gets the value of a cell using an offset from the top-left cell in the range.
Parameters¶
rowOffset int
Row offset from the top-left cell in the range
columnOffset int
Column offset from the top-left cell in the range
Returns¶
T
Type Parameters¶
T
The returned type
GetEnumerator()¶
Gets the enumerator for the collection
Returns¶
The enumerator
GetTable()¶
Returns the ExcelTable if the range is a table. If the range doesn't or partly matches a table range, null is returned. IsTable
Returns¶
GetValue<T>()¶
Convert cell value to desired type, including nullable structs. When converting blank string to nullable struct (e.g. ' ' to int?) null is returned. When attempted conversion fails exception is passed through.
Returns¶
T
The Value converted to T.
Type Parameters¶
T
The type to convert to.
Remarks¶
If Value is string, parsing is performed for output types of DateTime and TimeSpan, which if fails throws FormatException. Another special case for output types of DateTime and TimeSpan is when input is double, in which case FromOADate(double) is used for conversion. This special case does not work through other types convertible to double (e.g. integer or string with number). In all other cases 'direct' conversion ChangeType(object, Type) is performed.
Exceptions¶
Value is string and its format is invalid for conversion (parsing fails)
Value is not string and direct conversion fails
Insert(eShiftTypeInsert)¶
Insert cells into the worksheet and shift the cells to the selected direction.
Parameters¶
shift eShiftTypeInsert
The direction that the cells will shift.
Returns¶
IsEmpty(bool, bool, bool)¶
Returns true if the range is empty.
Parameters¶
formula bool
comment bool
threadedComment bool
Returns¶
LoadFromArrays(IEnumerable<object[]>)¶
Loads data from the collection of arrays of objects into the range, starting from the top-left cell.
Parameters¶
Data IEnumerable<object[]>
The data.
Returns¶
LoadFromArraysTransposed(IEnumerable<object[]>)¶
Loads data from the collection of arrays of objects into the range transposed, starting from the top-left cell.
Parameters¶
Data IEnumerable<object[]>
Returns¶
LoadFromCollection<T>(IEnumerable<T>)¶
Load a collection into a the worksheet starting from the top left row of the range.
Parameters¶
Collection IEnumerable<T>
The collection to load
Returns¶
The filled range
Type Parameters¶
T
The datatype in the collection
LoadFromCollection<T>(IEnumerable<T>, bool)¶
Load a collection of T into the worksheet starting from the top left row of the range. Default option will load all public instance properties of T
Parameters¶
Collection IEnumerable<T>
The collection to load
PrintHeaders bool
Print the property names on the first row. If the property is decorated with a DisplayNameAttribute or a DescriptionAttribute that attribute will be used instead of the reflected member name.
Returns¶
The filled range
Type Parameters¶
T
The datatype in the collection
LoadFromCollection<T>(IEnumerable<T>, bool, TableStyles?)¶
Load a collection of T into the worksheet starting from the top left row of the range. Default option will load all public instance properties of T
public ExcelRangeBase LoadFromCollection<T>(IEnumerable<T> Collection, bool PrintHeaders, TableStyles? TableStyle)
Parameters¶
Collection IEnumerable<T>
The collection to load
PrintHeaders bool
Print the property names on the first row. If the property is decorated with a DisplayNameAttribute or a DescriptionAttribute that attribute will be used instead of the reflected member name.
TableStyle TableStyles?
Will create a table with this style. If set to TableStyles.None no table will be created
Returns¶
The filled range
Type Parameters¶
T
The datatype in the collection
LoadFromCollection<T>(IEnumerable<T>, bool, TableStyles?, bool)¶
Load a collection of T into the worksheet starting from the top left row of the range. Default option will load all public instance properties of T
public ExcelRangeBase LoadFromCollection<T>(IEnumerable<T> Collection, bool PrintHeaders, TableStyles? TableStyle, bool Transpose)
Parameters¶
Collection IEnumerable<T>
The collection to load
PrintHeaders bool
Print the property names on the first row. If the property is decorated with a DisplayNameAttribute or a DescriptionAttribute that attribute will be used instead of the reflected member name.
TableStyle TableStyles?
Will create a table with this style. If set to TableStyles.None no table will be created
Transpose bool
Will load data transposed
Returns¶
The filled range
Type Parameters¶
T
The datatype in the collection
LoadFromCollection<T>(IEnumerable<T>, bool, TableStyles?, BindingFlags, MemberInfo[])¶
Load a collection into the worksheet starting from the top left row of the range.
public ExcelRangeBase LoadFromCollection<T>(IEnumerable<T> Collection, bool PrintHeaders, TableStyles? TableStyle, BindingFlags memberFlags, MemberInfo[] Members)
Parameters¶
Collection IEnumerable<T>
The collection to load
PrintHeaders bool
Print the property names on the first row. Any underscore in the property name will be converted to a space. If the property is decorated with a DisplayNameAttribute or a DescriptionAttribute that attribute will be used instead of the reflected member name.
TableStyle TableStyles?
Will create a table with this style. If set to TableStyles.None no table will be created
memberFlags BindingFlags
Property flags to use
Members MemberInfo[]
The properties to output. Must be of type T
Returns¶
The filled range
Type Parameters¶
T
The datatype in the collection
LoadFromCollection<T>(IEnumerable<T>, bool, TableStyles?, bool, BindingFlags, MemberInfo[])¶
Load a collection into the worksheet starting from the top left row of the range.
public ExcelRangeBase LoadFromCollection<T>(IEnumerable<T> Collection, bool PrintHeaders, TableStyles? TableStyle, bool Transpose, BindingFlags memberFlags, MemberInfo[] Members)
Parameters¶
Collection IEnumerable<T>
The collection to load
PrintHeaders bool
Print the property names on the first row. Any underscore in the property name will be converted to a space. If the property is decorated with a DisplayNameAttribute or a DescriptionAttribute that attribute will be used instead of the reflected member name.
TableStyle TableStyles?
Will create a table with this style. If set to TableStyles.None no table will be created
Transpose bool
Will insert data transposed
memberFlags BindingFlags
Property flags to use
Members MemberInfo[]
The properties to output. Must be of type T
Returns¶
The filled range
Type Parameters¶
T
The datatype in the collection
LoadFromCollection<T>(IEnumerable<T>, Action<LoadFromCollectionParams>)¶
Load a collection into the worksheet starting from the top left row of the range.
public ExcelRangeBase LoadFromCollection<T>(IEnumerable<T> collection, Action<LoadFromCollectionParams> paramsConfig)
Parameters¶
collection IEnumerable<T>
The collection to load
paramsConfig Action<LoadFromCollectionParams>
Action to provide parameters to the function
Returns¶
The filled range
Type Parameters¶
T
The datatype in the collection
Examples¶
sheet.Cells["C1"].LoadFromCollection(items, c =>
{
c.PrintHeaders = true;
c.TableStyle = TableStyles.Dark1;
});
LoadFromDataReader(IDataReader, bool, string, TableStyles)¶
Load the data from the datareader starting from the top left cell of the range
public ExcelRangeBase LoadFromDataReader(IDataReader Reader, bool PrintHeaders, string TableName, TableStyles TableStyle = TableStyles.None)
Parameters¶
Reader IDataReader
The datareader to loadfrom
PrintHeaders bool
Print the column caption property (if set) or the columnname property if not, on first row
TableName string
The name of the table
TableStyle TableStyles
The table style to apply to the data
Returns¶
The filled range
LoadFromDataReader(IDataReader, bool, string, bool, TableStyles)¶
Load the data from the datareader starting from the top left cell of the range
public ExcelRangeBase LoadFromDataReader(IDataReader Reader, bool PrintHeaders, string TableName, bool Transpose, TableStyles TableStyle = TableStyles.None)
Parameters¶
Reader IDataReader
The datareader to loadfrom
PrintHeaders bool
Print the column caption property (if set) or the columnname property if not, on first row
TableName string
The name of the table
Transpose bool
Transpose the data
TableStyle TableStyles
The table style to apply to the data
Returns¶
The filled range
LoadFromDataReader(IDataReader, bool)¶
Load the data from the datareader starting from the top left cell of the range
Parameters¶
Reader IDataReader
The datareader to load from
PrintHeaders bool
Print the caption property (if set) or the columnname property if not, on first row
Returns¶
The filled range
LoadFromDataReader(IDataReader, bool, bool)¶
Load the data from the datareader starting from the top left cell of the range
Parameters¶
Reader IDataReader
The datareader to load from
PrintHeaders bool
Print the caption property (if set) or the columnname property if not, on first row
Transpose bool
Must be true to transpose data
Returns¶
The filled range
LoadFromDataReaderAsync(DbDataReader, bool, string, TableStyles, CancellationToken?)¶
Load the data from the datareader starting from the top left cell of the range
public Task<ExcelRangeBase> LoadFromDataReaderAsync(DbDataReader Reader, bool PrintHeaders, string TableName, TableStyles TableStyle = TableStyles.None, CancellationToken? cancellationToken = null)
Parameters¶
Reader DbDataReader
The datareader to loadfrom
PrintHeaders bool
Print the column caption property (if set) or the columnname property if not, on first row
TableName string
The name of the table
TableStyle TableStyles
The table style to apply to the data
cancellationToken CancellationToken?
The cancellation token to use
Returns¶
The filled range
LoadFromDataReaderAsync(DbDataReader, bool, string, bool, TableStyles, CancellationToken?)¶
Load the data from the datareader starting from the top left cell of the range
public Task<ExcelRangeBase> LoadFromDataReaderAsync(DbDataReader Reader, bool PrintHeaders, string TableName, bool Transpose, TableStyles TableStyle = TableStyles.None, CancellationToken? cancellationToken = null)
Parameters¶
Reader DbDataReader
The datareader to loadfrom
PrintHeaders bool
Print the column caption property (if set) or the columnname property if not, on first row
TableName string
The name of the table
Transpose bool
TableStyle TableStyles
The table style to apply to the data
cancellationToken CancellationToken?
The cancellation token to use
Returns¶
The filled range
LoadFromDataReaderAsync(DbDataReader, bool)¶
Load the data from the datareader starting from the top left cell of the range
Parameters¶
Reader DbDataReader
The datareader to load from
PrintHeaders bool
Print the caption property (if set) or the columnname property if not, on first row
Returns¶
The filled range
LoadFromDataReaderAsync(DbDataReader, bool, bool)¶
Load the data from the datareader starting from the top left cell of the range
public Task<ExcelRangeBase> LoadFromDataReaderAsync(DbDataReader Reader, bool PrintHeaders, bool Transpose)
Parameters¶
Reader DbDataReader
The datareader to load from
PrintHeaders bool
Print the caption property (if set) or the columnname property if not, on first row
Transpose bool
If the data should be transposed on read or not
Returns¶
The filled range
LoadFromDataReaderAsync(DbDataReader, bool, CancellationToken)¶
Load the data from the datareader starting from the top left cell of the range
public Task<ExcelRangeBase> LoadFromDataReaderAsync(DbDataReader Reader, bool PrintHeaders, CancellationToken cancellationToken)
Parameters¶
Reader DbDataReader
The datareader to load from
PrintHeaders bool
Print the caption property (if set) or the columnname property if not, on first row
cancellationToken CancellationToken
The cancellation token to use
Returns¶
The filled range
LoadFromDataReaderAsync(DbDataReader, bool, CancellationToken, bool)¶
Load the data from the datareader starting from the top left cell of the range
public Task<ExcelRangeBase> LoadFromDataReaderAsync(DbDataReader Reader, bool PrintHeaders, CancellationToken cancellationToken, bool Transpose)
Parameters¶
Reader DbDataReader
The datareader to load from
PrintHeaders bool
Print the caption property (if set) or the columnname property if not, on first row
cancellationToken CancellationToken
The cancellation token to use
Transpose bool
Returns¶
The filled range
LoadFromDataTable(DataTable, bool, TableStyles?)¶
Load the data from the datatable starting from the top left cell of the range
public ExcelRangeBase LoadFromDataTable(DataTable Table, bool PrintHeaders, TableStyles? TableStyle)
Parameters¶
Table DataTable
The datatable to load
PrintHeaders bool
Print the column caption property (if set) or the columnname property if not, on first row
TableStyle TableStyles?
The table style to apply to the data
Returns¶
The filled range
LoadFromDataTable(DataTable, bool, TableStyles?, bool)¶
Load the data from the datatable starting from the top left cell of the range
public ExcelRangeBase LoadFromDataTable(DataTable Table, bool PrintHeaders, TableStyles? TableStyle, bool Transpose)
Parameters¶
Table DataTable
The datatable to load
PrintHeaders bool
Print the column caption property (if set) or the columnname property if not, on first row
TableStyle TableStyles?
The table style to apply to the data
Transpose bool
Transpose the loaded data
Returns¶
The filled range
LoadFromDataTable(DataTable, bool)¶
Load the data from the datatable starting from the top left cell of the range
Parameters¶
Table DataTable
The datatable to load
PrintHeaders bool
Print the caption property (if set) or the columnname property if not, on first row
Returns¶
The filled range
LoadFromDataTable(DataTable)¶
Load the data from the datatable starting from the top left cell of the range
Parameters¶
table DataTable
The datatable to load
Returns¶
The filled range
LoadFromDataTable(DataTable, Action<LoadFromDataTableParams>)¶
Load the data from the DataTable starting from the top left cell of the range
public ExcelRangeBase LoadFromDataTable(DataTable table, Action<LoadFromDataTableParams> paramsConfig)
Parameters¶
table DataTable
paramsConfig Action<LoadFromDataTableParams>
Action to provide parameters to the function
Returns¶
The filled range
Examples¶
sheet.Cells["C1"].LoadFromDataTable(dataTable, c =>
{
c.PrintHeaders = true;
c.TableStyle = TableStyles.Dark1;
});
LoadFromDictionaries(IEnumerable<IDictionary<string, object>>)¶
Load a collection of dictionaries (or dynamic/ExpandoObjects) into the worksheet starting from the top left row of the range. These dictionaries should have the same set of keys.
Parameters¶
items IEnumerable<IDictionary<string, object>>
A list of dictionaries/>
Returns¶
The filled range
Examples¶
var items = new List<IDictionary<string, object>>()
{
new Dictionary<string, object>()
{
{ "Id", 1 },
{ "Name", "TestName 1" }
},
new Dictionary<string, object>()
{
{ "Id", 2 },
{ "Name", "TestName 2" }
}
};
using(var package = new ExcelPackage())
{
var sheet = package.Workbook.Worksheets.Add("test");
var r = sheet.Cells["A1"].LoadFromDictionaries(items);
}
LoadFromDictionaries(IEnumerable<IDictionary<string, object>>, bool)¶
Load a collection of dictionaries (or dynamic/ExpandoObjects) into the worksheet starting from the top left row of the range. These dictionaries should have the same set of keys.
public ExcelRangeBase LoadFromDictionaries(IEnumerable<IDictionary<string, object>> items, bool printHeaders)
Parameters¶
items IEnumerable<IDictionary<string, object>>
A list of dictionaries/>
printHeaders bool
If true the key names from the first instance will be used as headers
Returns¶
The filled range
Examples¶
var items = new List<IDictionary<string, object>>()
{
new Dictionary<string, object>()
{
{ "Id", 1 },
{ "Name", "TestName 1" }
},
new Dictionary<string, object>()
{
{ "Id", 2 },
{ "Name", "TestName 2" }
}
};
using(var package = new ExcelPackage())
{
var sheet = package.Workbook.Worksheets.Add("test");
var r = sheet.Cells["A1"].LoadFromDictionaries(items, true);
}
LoadFromDictionaries(IEnumerable<IDictionary<string, object>>, bool, TableStyles?)¶
Load a collection of dictionaries (or dynamic/ExpandoObjects) into the worksheet starting from the top left row of the range. These dictionaries should have the same set of keys.
public ExcelRangeBase LoadFromDictionaries(IEnumerable<IDictionary<string, object>> items, bool printHeaders, TableStyles? tableStyle)
Parameters¶
items IEnumerable<IDictionary<string, object>>
A list of dictionaries/>
printHeaders bool
If true the key names from the first instance will be used as headers
tableStyle TableStyles?
Will create a table with this style. If set to TableStyles.None no table will be created
Returns¶
The filled range
Examples¶
var items = new List<IDictionary<string, object>>()
{
new Dictionary<string, object>()
{
{ "Id", 1 },
{ "Name", "TestName 1" }
},
new Dictionary<string, object>()
{
{ "Id", 2 },
{ "Name", "TestName 2" }
}
};
using(var package = new ExcelPackage())
{
var sheet = package.Workbook.Worksheets.Add("test");
var r = sheet.Cells["A1"].LoadFromDictionaries(items, true, TableStyles.None);
}
LoadFromDictionaries(IEnumerable<IDictionary<string, object>>, bool, TableStyles?, IEnumerable<string>)¶
Load a collection of dictionaries (or dynamic/ExpandoObjects) into the worksheet starting from the top left row of the range. These dictionaries should have the same set of keys.
public ExcelRangeBase LoadFromDictionaries(IEnumerable<IDictionary<string, object>> items, bool printHeaders, TableStyles? tableStyle, IEnumerable<string> keys)
Parameters¶
items IEnumerable<IDictionary<string, object>>
A list of dictionaries
printHeaders bool
If true the key names from the first instance will be used as headers
tableStyle TableStyles?
Will create a table with this style. If set to TableStyles.None no table will be created
keys IEnumerable<string>
Keys that should be used, keys omitted will not be included
Returns¶
The filled range
Examples¶
var items = new List<IDictionary<string, object>>()
{
new Dictionary<string, object>()
{
{ "Id", 1 },
{ "Name", "TestName 1" }
},
new Dictionary<string, object>()
{
{ "Id", 2 },
{ "Name", "TestName 2" }
}
};
using(var package = new ExcelPackage())
{
var sheet = package.Workbook.Worksheets.Add("test");
var r = sheet.Cells["A1"].LoadFromDictionaries(items, true, TableStyles.None, null);
}
LoadFromDictionaries(IEnumerable<dynamic>, bool, TableStyles?, IEnumerable<string>)¶
Load a collection of dictionaries (or dynamic/ExpandoObjects) into the worksheet starting from the top left row of the range. These dictionaries should have the same set of keys.
public ExcelRangeBase LoadFromDictionaries(IEnumerable<dynamic> items, bool printHeaders, TableStyles? tableStyle, IEnumerable<string> keys)
Parameters¶
items IEnumerable<dynamic>
A list of dictionaries
printHeaders bool
If true the key names from the first instance will be used as headers
tableStyle TableStyles?
Will create a table with this style. If set to TableStyles.None no table will be created
keys IEnumerable<string>
Keys that should be used, keys omitted will not be included
Returns¶
The filled range
Examples¶
var items = new List<IDictionary<string, object>>()
{
new Dictionary<string, object>()
{
{ "Id", 1 },
{ "Name", "TestName 1" }
},
new Dictionary<string, object>()
{
{ "Id", 2 },
{ "Name", "TestName 2" }
}
};
using(var package = new ExcelPackage())
{
var sheet = package.Workbook.Worksheets.Add("test");
var r = sheet.Cells["A1"].LoadFromDictionaries(items, true, TableStyles.None, null);
}
LoadFromDictionaries(IEnumerable<IDictionary<string, object>>, Action<LoadFromDictionariesParams>)¶
Load a collection of dictionaries (or dynamic/ExpandoObjects) into the worksheet starting from the top left row of the range. These dictionaries should have the same set of keys.
public ExcelRangeBase LoadFromDictionaries(IEnumerable<IDictionary<string, object>> items, Action<LoadFromDictionariesParams> paramsConfig)
Parameters¶
items IEnumerable<IDictionary<string, object>>
A list of dictionaries/ExpandoObjects
paramsConfig Action<LoadFromDictionariesParams>
Action to provide parameters to the function
Returns¶
Examples¶
sheet.Cells["C1"].LoadFromDictionaries(items, c => { c.PrintHeaders = true; c.TableStyle = TableStyles.Dark1; });
LoadFromDictionaries(IEnumerable<dynamic>, Action<LoadFromDictionariesParams>)¶
Load a collection of dictionaries (or dynamic/ExpandoObjects) into the worksheet starting from the top left row of the range. These dictionaries should have the same set of keys.
public ExcelRangeBase LoadFromDictionaries(IEnumerable<dynamic> items, Action<LoadFromDictionariesParams> paramsConfig)
Parameters¶
items IEnumerable<dynamic>
A list of dictionaries/ExpandoObjects
paramsConfig Action<LoadFromDictionariesParams>
Action to provide parameters to the function
Returns¶
Examples¶
sheet.Cells["C1"].LoadFromDictionaries(items, c => { c.PrintHeaders = true; c.TableStyle = TableStyles.Dark1; });
LoadFromText(string)¶
Loads a CSV text into a range starting from the top left cell. Default settings is Comma separation
Parameters¶
Text string
The Text
Returns¶
The range containing the data
LoadFromText(string, ExcelTextFormat)¶
Loads a CSV text into a range starting from the top left cell.
Parameters¶
Text string
The Text
Format ExcelTextFormat
Information how to load the text
Returns¶
The range containing the data
LoadFromText(string, ExcelTextFormat, TableStyles?, bool)¶
Loads a CSV text into a range starting from the top left cell.
public ExcelRangeBase LoadFromText(string Text, ExcelTextFormat Format, TableStyles? TableStyle, bool FirstRowIsHeader)
Parameters¶
Text string
The Text
Format ExcelTextFormat
Information how to load the text
TableStyle TableStyles?
Create a table with this style. If this parameter is not null no table will be created.
FirstRowIsHeader bool
Use the first row as header
Returns¶
LoadFromText(FileInfo)¶
Loads a CSV file into a range starting from the top left cell using ASCII Encoding.
Parameters¶
TextFile FileInfo
The Textfile
Returns¶
LoadFromText(FileInfo, ExcelTextFormat)¶
Loads a CSV file into a range starting from the top left cell.
Parameters¶
TextFile FileInfo
The Textfile
Format ExcelTextFormat
Information how to load the text
Returns¶
LoadFromText(FileInfo, ExcelTextFormat, TableStyles?, bool)¶
Loads a CSV file into a range starting from the top left cell.
public ExcelRangeBase LoadFromText(FileInfo TextFile, ExcelTextFormat Format, TableStyles? TableStyle, bool FirstRowIsHeader)
Parameters¶
TextFile FileInfo
The Textfile
Format ExcelTextFormat
Information how to load the text
TableStyle TableStyles?
Create a table with this style
FirstRowIsHeader bool
Use the first row as header
Returns¶
LoadFromText(string, ExcelTextFormatFixedWidth)¶
Loads a fixed width text file into range starting from the top left cell.
Parameters¶
Text string
The Text file
Format ExcelTextFormatFixedWidth
Information how to load the text
Returns¶
LoadFromText(FileInfo, ExcelTextFormatFixedWidth)¶
Loads a fixed width text file into range starting from the top left cell.
Parameters¶
TextFile FileInfo
The Textfile
Format ExcelTextFormatFixedWidth
Information how to load the text
Returns¶
LoadFromTextAsync(FileInfo)¶
Loads a CSV file into a range starting from the top left cell.
Parameters¶
TextFile FileInfo
The Textfile
Returns¶
LoadFromTextAsync(FileInfo, ExcelTextFormat)¶
Loads a CSV file into a range starting from the top left cell.
Parameters¶
TextFile FileInfo
The Textfile
Format ExcelTextFormat
Information how to load the text
Returns¶
LoadFromTextAsync(FileInfo, ExcelTextFormat, TableStyles, bool)¶
Loads a CSV file into a range starting from the top left cell.
public Task<ExcelRangeBase> LoadFromTextAsync(FileInfo TextFile, ExcelTextFormat Format, TableStyles TableStyle, bool FirstRowIsHeader)
Parameters¶
TextFile FileInfo
The Textfile
Format ExcelTextFormat
Information how to load the text
TableStyle TableStyles
Create a table with this style
FirstRowIsHeader bool
Use the first row as header
Returns¶
MoveNext()¶
Iterate to the next cell
Returns¶
False if no more cells exists
Offset(int, int)¶
Get a range with an offset from the top left cell. The new range has the same dimensions as the current range
Parameters¶
RowOffset int
Row Offset
ColumnOffset int
Column Offset
Returns¶
Offset(int, int, int, int)¶
Get a range with an offset from the top left cell.
public ExcelRangeBase Offset(int RowOffset, int ColumnOffset, int NumberOfRows, int NumberOfColumns)
Parameters¶
RowOffset int
Row Offset
ColumnOffset int
Column Offset
NumberOfRows int
Number of rows. Minimum 1
NumberOfColumns int
Number of colums. Minimum 1
Returns¶
Reset()¶
Reset the enumerator
SaveToJson(Stream)¶
Saves the range as JSON to a stream.
Parameters¶
stream Stream
The writable stream to write the JSON to.
SaveToJson(Stream, Action<JsonRangeExportSettings>)¶
Saves the range as JSON to a stream.
Parameters¶
stream Stream
The writable stream to write the JSON to
settings Action<JsonRangeExportSettings>
Configures settings for the JSON export
SaveToJsonAsync(Stream)¶
Save the range to json
Parameters¶
stream Stream
The stream to save to.
Returns¶
SaveToJsonAsync(Stream, Action<JsonRangeExportSettings>)¶
Save the range to json
Parameters¶
stream Stream
The stream to save to.
settings Action<JsonRangeExportSettings>
Settings for the json output.
Returns¶
SaveToText(FileInfo, ExcelOutputTextFormat)¶
Converts a range to text in CSV format. Invariant culture is used by default.
Parameters¶
file FileInfo
The file to write to
Format ExcelOutputTextFormat
Information how to create the csv text
SaveToText(Stream, ExcelOutputTextFormat)¶
Converts a range to text in CSV format. Invariant culture is used by default.
Parameters¶
stream Stream
The strem to write to
Format ExcelOutputTextFormat
Information how to create the csv text
SaveToText(FileInfo, ExcelOutputTextFormatFixedWidth)¶
Converts a range to text in fixed widths format. Invariant culture is used by default.
Parameters¶
file FileInfo
The file to write to
Format ExcelOutputTextFormatFixedWidth
Information how to create the fixed width text
SaveToText(Stream, ExcelOutputTextFormatFixedWidth)¶
Converts a range to text in Fixed Width format. Invariant culture is used by default.
Parameters¶
stream Stream
The strem to write to
Format ExcelOutputTextFormatFixedWidth
Information how to create the fixed width text
SaveToTextAsync(FileInfo, ExcelOutputTextFormat)¶
Converts a range to text in CSV format. Invariant culture is used by default.
Parameters¶
file FileInfo
The file to write to
Format ExcelOutputTextFormat
Information how to create the csv text
Returns¶
SaveToTextAsync(Stream, ExcelOutputTextFormat)¶
Converts a range to text in CSV format. Invariant culture is used by default.
Parameters¶
stream Stream
The strem to write to
Format ExcelOutputTextFormat
Information how to create the csv text
Returns¶
SaveToTextAsync(FileInfo, ExcelOutputTextFormatFixedWidth)¶
Converts a range to text in fixed widths format. Invariant culture is used by default.
Parameters¶
file FileInfo
The file to write to
Format ExcelOutputTextFormatFixedWidth
Information how to create the fixed width text
Returns¶
SaveToTextAsync(Stream, ExcelOutputTextFormatFixedWidth)¶
Converts a range to text in Fixed Width format. Invariant culture is used by default.
Parameters¶
stream Stream
The strem to write to
Format ExcelOutputTextFormatFixedWidth
Information how to create the fixed width text
Returns¶
SetCellValue(int, int, object)¶
Sets the value of a cell using an offset from the top-left cell in the range.
Parameters¶
rowOffset int
Row offset from the top-left cell in the range
columnOffset int
Column offset from the top-left cell in the range
value object
The value to set.
SetErrorValue(eErrorType)¶
Sets the range to an Error value
Parameters¶
errorType eErrorType
The type of error
SetHyperlink(Uri)¶
Sets the hyperlink property
Parameters¶
uri Uri
The URI to set
SetHyperlink(ExcelHyperLink)¶
Sets the Hyperlink property using the ExcelHyperLink class.
Parameters¶
uri ExcelHyperLink
The ExcelHyperLink uri to set
SetHyperlink(ExcelRange, string)¶
Sets the Hyperlink property to an url within the workbook.
Parameters¶
range ExcelRange
A reference within the same workbook
display string
The displayed text in the cell. If display is null or empty, the address of the range will be set.
SetHyperlink(ExcelRange)¶
Sets the Hyperlink property to an url within the workbook. The hyperlink will display the value of the cell.
Parameters¶
range ExcelRange
A reference within the same workbook
Sort()¶
Sort the range by value of the first column, Ascending.
Sort(int, bool)¶
Sort the range by value of the supplied column, Ascending. The column to sort by within the range. Zerobased Descending if true, otherwise Ascending. Default Ascending. Zerobased
Parameters¶
column int
descending bool
Sort(int[], bool[], CultureInfo, CompareOptions)¶
Sort the range by value
public void Sort(int[] columns, bool[] descending = null, CultureInfo culture = null, CompareOptions compareOptions = CompareOptions.None)
Parameters¶
columns int[]
The column(s) to sort by within the range. Zerobased
descending bool[]
Descending if true, otherwise Ascending. Default Ascending. Zerobased
culture CultureInfo
The CultureInfo used to compare values. A null value means CurrentCulture
compareOptions CompareOptions
String compare option
Sort(Action<RangeSortOptions>)¶
Sort the range by value. Supports top-down and left to right sort.
Parameters¶
configuration Action<RangeSortOptions>
An action of RangeSortOptions where sort parameters can be set.
Examples¶
// 1. Sort rows (top-down)
// The Column function takes the zero based column index in the range
worksheet.Cells["A1:D15"].Sort(x => x.SortBy.Column(0).ThenSortBy.Column(1, eSortOrder.Descending));
// 2. Sort columns(left to right)
// The Row function takes the zero based row index in the range
worksheet.Cells["A1:D15"].Sort(x => x.SortLeftToRightBy.Row(0));
// 3. Sort using a custom list
worksheet.Cells["A1:D15"].Sort(x => x.SortBy.Column(0).UsingCustomList("S", "M", "L", "XL"));
worksheet.Cells["A1:D15"].Sort(x => x.SortLeftToRightBy.Row(0).UsingCustomList("S", "M", "L", "XL"));
Sort(RangeSortOptions)¶
Sort the range by value. Use RangeSortOptions.Create() to create an instance of the sort options, then use the SortBy or SortLeftToRightBy properties to build up your sort parameters.
Parameters¶
options RangeSortOptions
RangeSortOptions?text=Options for the sort
Examples¶
var options = RangeSortOptions.Create();
var builder = options.SortBy.Column(0);
builder.ThenSortBy.Column(2).UsingCustomList("S", "M", "L", "XL");
builder.ThenSortBy.Column(3);
worksheet.Cells["A1:D15"].Sort(options);
ToCollection<T>()¶
Returns a collection of T for the range. If the range contains multiple addresses the first range is used. The first row must contain the unique headers used as keys in the row dictionary. Headers will be mapped to properties using the name or the attributes without white spaces. The attributes that can be used are: EpplusTableColumnAttributeBase.Header, DescriptionAttribute.Description or DisplayNameAttribute.Name.
Returns¶
List<T>
A list of T
Type Parameters¶
T
The type to map to
ToCollection<T>(Action<ToCollectionRangeOptions>)¶
Automatically maps the range to the properties T using the headers. Using this method requires a headers. Headers will be mapped to properties using the name or the attributes without white spaces. The attributes that can be used are: EpplusTableColumnAttributeBase.Header, DescriptionAttribute.Description or DisplayNameAttribute.Name.
Parameters¶
options Action<ToCollectionRangeOptions>
Configures the settings for the function
Returns¶
List<T>
A list of T
Type Parameters¶
T
The type to use
ToCollection<T>(ToCollectionRangeOptions)¶
Automatically maps the range to the properties T using the headers. Using this method requires a headers. Headers will be mapped to properties using the name or the attributes without white spaces. The attributes that can be used are: EpplusTableColumnAttributeBase.Header, DescriptionAttribute.Description or DisplayNameAttribute.Name.
Parameters¶
options ToCollectionRangeOptions
Settings for the method
Returns¶
List<T>
A list of T
Type Parameters¶
T
The type to use
ToCollectionWithMappings<T>(Func<ToCollectionRow, T>)¶
Returns a collection of T for the range. If the range contains multiple addresses the first range is used. The first row must containt the unique headers used as keys in the row dictionary.
Parameters¶
setRow Func<ToCollectionRow, T>
The call back function to map each row to the item of type T.
Returns¶
List<T>
A list of T
Type Parameters¶
T
The type to map to
ToCollectionWithMappings<T>(Func<ToCollectionRow, T>, Action<ToCollectionRangeOptions>)¶
Returns a collection of T for the range. If the range contains multiple addresses the first range is used. The first row must contain the unique headers used as keys in the row dictionary.
public List<T> ToCollectionWithMappings<T>(Func<ToCollectionRow, T> setRow, Action<ToCollectionRangeOptions> options)
Parameters¶
setRow Func<ToCollectionRow, T>
The call back function to map each row to the item of type T.
options Action<ToCollectionRangeOptions>
Configures the settings for the function
Returns¶
List<T>
A list of T
Type Parameters¶
T
The type to map to
ToCollectionWithMappings<T>(Func<ToCollectionRow, T>, ToCollectionRangeOptions)¶
Returns a collection of T for the range. If the range contains multiple addresses the first range is used. The first row must containt the unique headers used as keys in the row dictionary.
public List<T> ToCollectionWithMappings<T>(Func<ToCollectionRow, T> setRow, ToCollectionRangeOptions options)
Parameters¶
setRow Func<ToCollectionRow, T>
The call back function to map each row to the item of type T.
options ToCollectionRangeOptions
Parameters to the function
Returns¶
List<T>
A list of T
Type Parameters¶
T
The type to map to
ToDataTable()¶
Returns the range as a DataTable with the Default settings.
Returns¶
A DataTable representing the range.
ToDataTable(Action<ToDataTableOptions>)¶
Returns the range as a DataTable with the option supplied.
Parameters¶
configHandler Action<ToDataTableOptions>
Configures the settings used to convert the range.
Returns¶
A DataTable representing the range.
ToDataTable(ToDataTableOptions)¶
Returns the range as a DataTable with the option supplied.
Parameters¶
options ToDataTableOptions
Sets the settings used to convert the range.
Returns¶
A DataTable representing the range.
ToDataTable(Action<ToDataTableOptions>, DataTable)¶
Returns the range as a DataTable with the option supplied.
Parameters¶
configHandler Action<ToDataTableOptions>
Configures the settings used to convert the range.
dataTable DataTable
The data table to add the range data to.
Returns¶
A DataTable representing the range.
ToDataTable(DataTable)¶
Returns the range as a DataTable with the option supplied.
Parameters¶
dataTable DataTable
The data table to add the range data to.
Returns¶
A DataTable representing the range.
ToDataTable(ToDataTableOptions, DataTable)¶
Returns the range as a DataTable with the option supplied.
Parameters¶
options ToDataTableOptions
Sets the settings used to convert the range.
dataTable DataTable
The data table to add the range data to.
Returns¶
A DataTable representing the range.
ToJson()¶
Returns the range as JSON
Returns¶
A JSON string
ToJson(Action<JsonRangeExportSettings>)¶
Returns the range as JSON
Parameters¶
settings Action<JsonRangeExportSettings>
Configures settings for the JSON export
Returns¶
ToText()¶
Converts a range to text in CSV format.
Returns¶
A string containing the text
ToText(ExcelOutputTextFormat)¶
Converts a range to text in CSV format. Invariant culture is used by default.
Parameters¶
Format ExcelOutputTextFormat
Information how to create the csv text
Returns¶
A string containing the text
ToText(ExcelOutputTextFormatFixedWidth)¶
Converts a range to text in Fixed Width format. Invariant culture is used by default.
Parameters¶
Format ExcelOutputTextFormatFixedWidth
Information how to create the Fixed Width text
Returns¶
A string containing the text
ToTextAsync()¶
Converts a range to text in CSV format.
Returns¶
A string containing the text
ToTextAsync(ExcelOutputTextFormat)¶
Converts a range to text in CSV format. Invariant culture is used by default.
Parameters¶
Format ExcelOutputTextFormat
Information how to create the csv text
Returns¶
A string containing the text
ToTextAsync(ExcelOutputTextFormatFixedWidth)¶
Converts a range to text in Fixed Width format. Invariant culture is used by default.
Parameters¶
Format ExcelOutputTextFormatFixedWidth
Information how to create the Fixed Width text
Returns¶
A string containing the text