[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IRange

Interface IRange

Namespace
GrapeCity.Documents.Excel
Assembly
GcDocs.Excel.dll

Represents the IRange object.

public interface IRange

Properties

AddIndent

Gets or sets the property which controls indentation of text when horizontal or vertical alignment is set to distributed.

bool AddIndent { get; set; }

Property Value

bool

true if [add indent]; otherwise, false.

Address

Gets a string value that represents the range reference in the absolute A1 format.

string Address { get; }

Property Value

string

Remarks

For more address formats, use the GetAddress(bool, bool, ReferenceStyle, IRange) method.

Areas

Returns an instance of IAreas which represents an array of IRanges where each IRange returned by IAreas represents one cell or range.

IAreas Areas { get; }

Property Value

IAreas

The areas.

BackgroundImage

Gets or sets the cell background image. Supported image types include: PNG, JPG, ICO, SVG, GIF. This would be visible only in SpreadJS and Exporting to PDF/HTML/IMG.

byte[] BackgroundImage { get; set; }

Property Value

byte[]

The cell backgroud image. Type is byte[], where byte[] represents image byte array.

BackgroundImageLayout

Gets or sets the cell background image layout, default is Stretch.

BackgroundImageLayout BackgroundImageLayout { get; set; }

Property Value

BackgroundImageLayout

The cell backgroud image layout.

BindingPath

Gets or sets the binding path of the current cell or column. If range is normal range, gets or sets the binding path of the top-left cell of range. If range is EntireColumn, gets or sets the binding path of the left column binding path of range. If range is EntireRow, gets or sets null.

string BindingPath { get; set; }

Property Value

string

Borders

Returns an instance of IBorders which represents the cell borders of the cell or range represented by this IRange.

IBorders Borders { get; }

Property Value

IBorders

The borders.

CellPadding

Gets or sets the cell padding for range. SpreadJS only.

ICellPadding CellPadding { get; set; }

Property Value

ICellPadding

Cells

Returns the IRange object that represents the cells in the specified range.

IRange Cells { get; }

Property Value

IRange

CellType

Gets or sets the cell type for specified range in the sheet.

BaseCellType CellType { get; set; }

Property Value

BaseCellType

The cell type.

Column

Returns the zero based column number of the first column of the first range.

int Column { get; }

Property Value

int

The column.

ColumnCount

Returns the column count of the first range.

int ColumnCount { get; }

Property Value

int

The column.

Columns

Returns the IRange object that represents the columns in the specified range.

IRange Columns { get; }

Property Value

IRange

ColumnWidth

Gets or sets the width of the individual columns represented in this range in characters.

double ColumnWidth { get; set; }

Property Value

double

ColumnWidthInPixel

Gets or sets the width of the individual columns represented in this range in pixels.

double ColumnWidthInPixel { get; set; }

Property Value

double

Comment

Returns an instance of IComment which may be used to get and set Comment properties of the cells.

IComment Comment { get; }

Property Value

IComment

CommentThreaded

Returns an instance of ICommentThreaded which may be used to get and set ICommentThreaded properties of the cells.

ICommentThreaded CommentThreaded { get; }

Property Value

ICommentThreaded

Count

Returns the number of objects in the collection.

int Count { get; }

Property Value

int

The object count.

CurrentArray

Gets whether the specified cell is part of an array, returns an IRange object that represents the entire array.

IRange CurrentArray { get; }

Property Value

IRange

DefaultValue

Gets or sets the default value of the cell, it can be the value data or the formula string. It works when the cell has no data.

object DefaultValue { get; set; }

Property Value

object

DisplayFormat

Gets a DisplayFormat object that represents the display settings for the specified range.

IDisplayFormat DisplayFormat { get; }

Property Value

IDisplayFormat

EntireColumn

Returns a new instance of IRange which represents the same range of cells, but expanded to include all rows.

IRange EntireColumn { get; }

Property Value

IRange

EntireMergeArea

Returns an IRange representing the area of the current IRange which is iteratively grown as needed until it includes no partial merged cells.

IRange EntireMergeArea { get; }

Property Value

IRange

EntireRow

Returns a new instance of IRange which represents the same range of cells, but expanded to include all columns.

IRange EntireRow { get; }

Property Value

IRange

Font

Returns an instance of IFont which may be used to get and set font properties of the cells represented by this IRange.

IFont Font { get; }

Property Value

IFont

The font.

FormatConditions

Returns a FormatConditions collection that represents all the conditional formats for the specified range.

IFormatConditions FormatConditions { get; }

Property Value

IFormatConditions

Formula

Gets or sets the formula of the cells represented by this IRange in A1-style notation.

string Formula { get; set; }

Property Value

string

The formula.

Formula2

Gets or sets the formula of the cells represented by this IRange in A1-style array notation.

string Formula2 { get; set; }

Property Value

string

The formula.

Formula2Local

Gets or sets the localized formula of the cells represented by this IRange in A1-style array notation.

string Formula2Local { get; set; }

Property Value

string

The formula.

Formula2R1C1

Gets or sets the formula of the cells represented by this IRange in R1C1-style array notation.

string Formula2R1C1 { get; set; }

Property Value

string

Formula2R1C1Local

Gets or sets the localized formula in array notation of the cells represented by this IRange in R1C1-style array notation.

string Formula2R1C1Local { get; set; }

Property Value

string

FormulaArray

Gets or sets the array formula of a range.

string FormulaArray { get; set; }

Property Value

string

FormulaArrayR1C1

Gets or sets the array formula of a range, using ReferenceStyle.R1C1.

string FormulaArrayR1C1 { get; set; }

Property Value

string

FormulaHidden

Gets or sets whether the formula will be hidden when the worksheet is protected.

bool FormulaHidden { get; set; }

Property Value

bool

FormulaLocal

Gets or sets the localized formula of the cells represented by this IRange in A1-style notation.

string FormulaLocal { get; set; }

Property Value

string

The formula.

FormulaR1C1

Gets or sets the formula of the cells represented by this IRange in R1C1-style notation.

string FormulaR1C1 { get; set; }

Property Value

string

FormulaR1C1Local

Gets or sets the localized formula of the cells represented by this IRange in R1C1-style notation.

string FormulaR1C1Local { get; set; }

Property Value

string

HasArray

Determines if the specified cell is part of an array formula.

bool HasArray { get; }

Property Value

bool

HasFormula

Returns true if the cell or range contains any formulas; otherwise, false is returned.

bool HasFormula { get; }

Property Value

bool

true if this instance has formula; otherwise, false.

HasValidation

Returns true if any of the cells represented by this range have data validation associated with them.

bool HasValidation { get; }

Property Value

bool

Height

Gets the height, in points, of the range.

double Height { get; }

Property Value

double

HeightInPixel

Gets the height, in pixels, of the range.

double HeightInPixel { get; }

Property Value

double

Hidden

Gets or sets the property which specifies whether rows or columns should be hidden.

bool Hidden { get; set; }

Property Value

bool

true if hidden; otherwise, false.

HorizontalAlignment

Gets or sets the HorizontalAlignment of a cell or range.

HorizontalAlignment HorizontalAlignment { get; set; }

Property Value

HorizontalAlignment

The horizontal alignment.

Returns an instance of IHyperLinks which may be used to get and set HyperLinks properties.

IHyperlinks Hyperlinks { get; }

Property Value

IHyperlinks

IgnoredError

Gets or sets the error type of the range to be ignored.

IgnoredErrorType IgnoredError { get; set; }

Property Value

IgnoredErrorType

IndentLevel

Gets or sets the indent level of the specified cell(s).

int IndentLevel { get; set; }

Property Value

int

The indent level.

Interior

Returns the IInterior which represents the interior (background) color and pattern of the specified cell(s).

IInterior Interior { get; }

Property Value

IInterior

The interior.

IsRichText

Indicates whether the cell string value is a rich text.

bool IsRichText { get; }

Property Value

bool

this[int, int]

Returns a new instance of IRange which is offset from this IRange.

IRange this[int rowOffset, int columnOffset] { get; }

Parameters

rowOffset int

The row offset.

columnOffset int

The column offset.

Property Value

IRange

IRange.

this[int]

Returns a new instance of IRange by index which represents a cell.

IRange this[int index] { get; }

Parameters

index int

The index of range.

Property Value

IRange

IRange.

LabelOptions

Gets or sets the setting for watermark. SpreadJS only.

ILabelOptions LabelOptions { get; }

Property Value

ILabelOptions

LastColumn

Returns the zero based column number of the last column of the first range.

int LastColumn { get; }

Property Value

int

The column.

LastRow

Returns the zero based row number of the last row of the first range.

int LastRow { get; }

Property Value

int

The row.

Locked

Gets or sets the property which specifies whether cells should be locked.

bool Locked { get; set; }

Property Value

bool

true if locked; otherwise, false.

MergeArea

Returns an IRange representing the merged range containing the specified cell. If the specified cell isn't in a merged range, this property returns the specified cell.

IRange MergeArea { get; }

Property Value

IRange

MergeCells

Gets or sets the property which specifies whether cells are merged.

bool MergeCells { get; set; }

Property Value

bool

NumberFormat

Gets or sets the number format of the cells in the range.

string NumberFormat { get; set; }

Property Value

string

Orientation

Gets or sets the text orientation of a cell or range, which may be from -90 to 90 degrees, or 255(vertical text).

int Orientation { get; set; }

Property Value

int

The orientation.

OutlineLevel

Gets or sets the current outline level of the specified row or column.

int OutlineLevel { get; set; }

Property Value

int

ReadingOrder

Gets or sets the reading order for the specified object.

ReadingOrder ReadingOrder { get; set; }

Property Value

ReadingOrder

RichText

Gets the rich text object associate with the top-left cell of this range.

IRichText RichText { get; }

Property Value

IRichText

Row

Returns the zero based row number of the first row of the first range.

int Row { get; }

Property Value

int

The row.

RowCount

Returns the row count of the first range.

int RowCount { get; }

Property Value

int

The row.

RowHeight

Gets or sets the height of the individual rows represented by this range in points.

double RowHeight { get; set; }

Property Value

double

RowHeightInPixel

Gets or sets the height of the individual rows represented by this range in pixels.

double RowHeightInPixel { get; set; }

Property Value

double

Rows

Returns the IRange object that represents the rows in the specified range.

IRange Rows { get; }

Property Value

IRange

ShowDetail

Gets or sets whether to show the detail (Returns True if the outline is expanded for the specified range, so that the detail of the column or row is visible). The specified range must be a single summary column or row in an outline (read or write).

bool ShowDetail { get; set; }

Property Value

bool

Remarks

The following statements are true: 1.The range must be in a single summary row or column. 2.This property returns False if any of the children of the row or column are hidden. 3.Setting this property to True is equivalent to unhiding all the children of the summary row or column. 4.Setting this property to False is equivalent to hiding all the children of the summary row or column.

ShrinkToFit

Gets or sets the property which specifies whether cells will be drawn in a smaller font if needed to display the contents of the cell.

bool ShrinkToFit { get; set; }

Property Value

bool

true if [shrink to fit]; otherwise, false.

SparklineGroups

Returns an instance of ISparklineGroups which may be used to get and set SparklineGroups properties of the cells

ISparklineGroups SparklineGroups { get; }

Property Value

ISparklineGroups

Style

Gets or sets the named style IStyle associated with the cells represented by this IRange.

IStyle Style { get; set; }

Property Value

IStyle

The style.

Summary

Determines if the range is an outlining summary row or column.

bool Summary { get; }

Property Value

bool

Tag

Gets or sets the tag value for specified range in the sheet. SpreadJS only.

object Tag { get; set; }

Property Value

object

The tag value.

Text

Gets the value of the cell represented by this IRange as a formatted string.

string Text { get; }

Property Value

string

The text.

UsedRange

Returns an IRange representing the used range in the current range.

IRange UsedRange { get; }

Property Value

IRange

UseStandardHeight

Determines if the row height of the IRange object equals the standard height of the sheet.

bool UseStandardHeight { get; set; }

Property Value

bool

UseStandardWidth

Determines if the column width of the IRange object equals the standard width of the sheet.

bool UseStandardWidth { get; set; }

Property Value

bool

Validation

Returns an instance of IValidation which may be used to get and set validation properties of the cells represented by this IRange.

IValidation Validation { get; }

Property Value

IValidation

ValidationIsSame

Returns true if the validation options of all cells represented by this IRange are the same; otherwise, false is returned.

bool ValidationIsSame { get; }

Property Value

bool

Value

Gets the value of the specified range as a string, double, bool, object[,] (Object(,) in Visual Basic) or null (Nothing in Visual Basic); or sets the value of the specified cell as a string, double, System.Int16, int, long, bool, System.DateTime, System.TimeSpan, object[,] (Object(,) in Visual Basic) or null (Nothing in Visual Basic).

object Value { get; set; }

Property Value

object

The value.

VerticalAlignment

Gets or sets the VerticalAlignment of a cell or range.

VerticalAlignment VerticalAlignment { get; set; }

Property Value

VerticalAlignment

The vertical alignment.

Watermark

Gets or sets the watermark for range. SpreadJS only.

string Watermark { get; set; }

Property Value

string

Width

Gets the width, in points, of the range.

double Width { get; }

Property Value

double

WidthInPixel

Gets the width, in pixels, of the range.

double WidthInPixel { get; }

Property Value

double

Worksheet

Returns the parent Worksheet of this range.

IWorksheet Worksheet { get; }

Property Value

IWorksheet

The worksheet.

WrapText

Get or sets the flag which indicates whether word wrap is enabled in a cell.

bool WrapText { get; set; }

Property Value

bool

true if [wrap text]; otherwise, false.

Methods

Activate()

Activates a single cell, which must be inside the current selection.

void Activate()

AddComment(string)

Adds comments to the current IRange.

IComment AddComment(string text)

Parameters

text string

The text you want to add.

Returns

IComment

AddCommentThreaded(string, string)

Adds a threaded comment to the current IRange.

ICommentThreaded AddCommentThreaded(string text, string author = null)

Parameters

text string

The text you want to add.

author string

The name of the author.

Returns

ICommentThreaded

The newly added threaded comment.

AutoFilter(bool, int, object, AutoFilterOperator, object, bool)

Filters a list using the AutoFilter.

void AutoFilter(bool isFirstRowData, int field = 0, object criteria1 = null, AutoFilterOperator op = AutoFilterOperator.And, object criteria2 = null, bool visibleDropDown = true)

Parameters

isFirstRowData bool

Indicates whether the first row of the selection area participates in filtering. When set to true, the behavior is consistent with SpreadJS; when false, it is consistent with Microsoft Excel.

field int

Optional Object. The integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field zero).

criteria1 object

Optional Object. The criteria (a string; for example, "101"). Use "=" to find blank fields, or use "<>" to find nonblank fields. If this argument is omitted, the criteria is All. If Operator is xlTop10Items, Criteria1 specifies the number of items (for example, "10").

op AutoFilterOperator

Optional AutoFilterOperator.

criteria2 object

Optional Object. The second criteria (a string). Used with Criteria1 and Operator to construct compound criteria.

visibleDropDown bool

Optional Object. True to display the AutoFilter drop-down arrow for the filtered field; False to hide the AutoFilter drop-down arrow for the filtered field. True by default.

AutoFilter(int, object, AutoFilterOperator, object, bool)

Filters a list using the AutoFilter.

void AutoFilter(int field = 0, object criteria1 = null, AutoFilterOperator op = AutoFilterOperator.And, object criteria2 = null, bool visibleDropDown = true)

Parameters

field int

Optional Object. The integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field zero).

criteria1 object

Optional Object. The criteria (a string; for example, "101"). Use "=" to find blank fields, or use "<>" to find nonblank fields. If this argument is omitted, the criteria is All. If Operator is xlTop10Items, Criteria1 specifies the number of items (for example, "10").

op AutoFilterOperator

Optional AutoFilterOperator.

criteria2 object

Optional Object. The second criteria (a string). Used with Criteria1 and Operator to construct compound criteria.

visibleDropDown bool

Optional Object. True to display the AutoFilter drop-down arrow for the filtered field; False to hide the AutoFilter drop-down arrow for the filtered field. True by default.

AutoFit()

Changes the width of the columns in the range or the height of the rows in the range to achieve the best fit.

void AutoFit()

AutoFit(bool)

Changes the width of the columns in the range or the height of the rows in the range to achieve the best fit. considerMergedCell Indicates whether to consider merged cells in a single row.

void AutoFit(bool considerMergedCell)

Parameters

considerMergedCell bool

Calculate()

Calculates formulas of the range as needed.

void Calculate()

Characters(int, int)

Returns a ITextRun object that represents a range of characters within the cell text, this method can only be called when the value of cell is a string, or else System.InvalidOperationException is thrown.

ITextRun Characters(int startIndex, int length)

Parameters

startIndex int

the start index of characters in whole cell text.

length int

the length of characters.

Returns

ITextRun

A ITextRun object that represents the range of characters.

Clear()

Clears formulas, values, and all formatting from the current IRange.

void Clear()

ClearComments()

Clears the comments from the current IRange.

void ClearComments()

ClearCommentsThreaded()

Clears the threaded comment from the current IRange.

void ClearCommentsThreaded()

ClearContents()

Clears formulas and values from the current IRange.

void ClearContents()

ClearFormats()

Clears all formatting from the current IRange.

void ClearFormats()

Clears all hyperLinks from the current IRange.

void ClearHyperlinks()

ClearOutline()

Clears the outline for the specified range.

void ClearOutline()

Copy(IRange, PasteOption)

Copies the range to the specified range.

void Copy(IRange destination, PasteOption pasteOption)

Parameters

destination IRange

Specifies the new range to which the specified range will be pasted. It can be the range of the same or another workbook.

pasteOption PasteOption

Specifies the part of the range to be pasted and whether to include hidden range.

Copy(IRange, PasteType)

Copies the range to the specified range.

[Obsolete("Please use the PasteOption overload instead.")]
void Copy(IRange destination, PasteType pasteType = PasteType.Default)

Parameters

destination IRange

Specifies the new range to which the specified range will be pasted. It can be the range of the same or another workbook.

pasteType PasteType

Specifies the part of the range to be pasted.

Copy(IRange)

Copies the range to the specified range.

void Copy(IRange destination)

Parameters

destination IRange

Specifies the new range to which the specified range will be pasted. It can be the range of the same or another workbook.

Cut(IRange)

Cuts the range to the specified range.

void Cut(IRange destination)

Parameters

destination IRange

Specifies the new range to which the specified range will be pasted. It can be the range of the same or another workbook.

Delete(DeleteShiftDirection)

Deletes a cell or a range of cells from the worksheet and shifts other cells to replace deleted cells.

Specifies which way to shift the cells.
void Delete(DeleteShiftDirection shiftDirection = DeleteShiftDirection.Auto)

Parameters

shiftDirection DeleteShiftDirection

Dirty()

Designates all the formulas of the range to be recalculated when the next calculation occurs.

void Dirty()

Find(object, IRange, FindOptions)

Finds specific information in a range.

IRange Find(object what, IRange after = null, FindOptions options = null)

Parameters

what object

The data to search for. Can be a string, double, System.DateTime, System.TimeSpan, bool or int.

after IRange

The cell after which you want the search to begin. This corresponds to the position of the active cell when a search is done from the user interface. Notice that After must be a single cell in the range. Remember that the search begins after this cell; the specified cell isn't searched unless your code wraps back around to this cell. If you do not specify this argument, the search starts at the cell in the upper-left corner of the range when SearchDirection is Next, or at the cell in the bottom-right corner of the range when SearchDirection is Previous.

options FindOptions

The find options.

Returns

IRange

A IRange object that represents the first cell where that information is found.

FromJson(string)

Generates the range data from the JSON string.

void FromJson(string json)

Parameters

json string

the JSON string that contains range info.

GenerateGetPivotDataFunction(IRange)

Generate the corresponding function "GETPIVOTDATA" for the cells in the pivot table.

string GenerateGetPivotDataFunction(IRange destination = null)

Parameters

destination IRange

Indicates for which area the "GETPIVOTDATA" function is generated.

Returns

string

"GETPIVOTDATA" function

GetAddress(bool, bool, ReferenceStyle, IRange)

Returns a string value that represents the range reference. If all parameters are omitted, the return value is equal to the Address property.

string GetAddress(bool rowAbsolute = true, bool columnAbsolute = true, ReferenceStyle referenceStyle = ReferenceStyle.A1, IRange relativeTo = null)

Parameters

rowAbsolute bool

True to return the row part of the reference as an absolute reference.

columnAbsolute bool

True to return the column part of the reference as an absolute reference.

referenceStyle ReferenceStyle

The reference style.

relativeTo IRange

If RowAbsolute and ColumnAbsolute are False, and ReferenceStyle is R1C1, defines a starting point for the relative reference. The default reference is $A$1.

Returns

string

GetDependents()

Gets the dependent ranges of the left top cell of the range.

IReadOnlyList<IRange> GetDependents()

Returns

System.Collections.Generic.IReadOnlyList<T><IRange>

The dependent ranges.

GetDependents(bool)

Gets the dependent ranges of all the cells of the range.

IReadOnlyList<IRange> GetDependents(bool includeIndirect)

Parameters

includeIndirect bool

Include the indirect dependent cells.

Returns

System.Collections.Generic.IReadOnlyList<T><IRange>

The dependent ranges.

GetPrecedents()

Gets the precedent ranges of the left top cell of the range.

IReadOnlyList<IRange> GetPrecedents()

Returns

System.Collections.Generic.IReadOnlyList<T><IRange>

The precedent ranges.

GetPrecedents(bool)

Gets the precedent ranges of all the cells of the range.

IReadOnlyList<IRange> GetPrecedents(bool includeIndirect)

Parameters

includeIndirect bool

Include the indirect precedent cells.

Returns

System.Collections.Generic.IReadOnlyList<T><IRange>

The precedent ranges.

GetUsedRange(UsedRangeType)

Gets an IRange representing the used range in the current range.

IRange GetUsedRange(UsedRangeType type = UsedRangeType.All)

Parameters

type UsedRangeType

The feature type.

Returns

IRange

GoalSeek(double, IRange)

Attempts to achieve the specified goal, from the calculated result of the formula in the cell represented by this IRange, by modifying the specified changingCell. If you know the result that you want from a formula, but are not sure what input value the formula needs to get that result, use the Goal Seek feature.

bool GoalSeek(double goal, IRange changingCell)

Parameters

goal double

Specifies the desired goal value.

changingCell IRange

Specifies the cell to change.

Returns

bool

True if the desired result value is successfully found, otherwise False.

Group()

Increments the OutlineLevel of the specified rows or columns.

void Group()

Insert(InsertShiftDirection)

Inserts a cell or a range of cells into the worksheet and shifts other cells away to make space.

Specifies which way to shift the cells.
void Insert(InsertShiftDirection shiftDirection = InsertShiftDirection.Auto)

Parameters

shiftDirection InsertShiftDirection

Intersect(IRange)

Returns an IRange object that represents the intersection of two ranges.
If range2 is from a different worksheet, an exception is thrown.

IRange Intersect(IRange range2)

Parameters

range2 IRange

The range to intersect with this range.

Returns

IRange

A new range which consists of the intersection of this range and range2, or null if the ranges do not intersect.

Intersect(params IRange[])

Returns an IRange object that represents the intersection of several ranges.
If one or more ranges from a different worksheet are specified, an exception is thrown.

IRange Intersect(params IRange[] ranges)

Parameters

ranges IRange[]

The intersecting ranges.

Returns

IRange

A new range which consists of the intersection of this range and other ranges, or null if the ranges do not intersect.

Merge(bool)

Merges the cells in the represented range into a single merged cell.

void Merge(bool isAcross = false)

Parameters

isAcross bool

Optional Object. True to merge cells in each row of the specified range as separate merged cells. The default value is False.

Offset(int, int)

Returns an IRange object that represents the offset of this range.

IRange Offset(int rowOffset, int columnOffset)

Parameters

rowOffset int

Row offset.

columnOffset int

Column offset.

Returns

IRange

A new range which consists of the offset of this range.

RemoveSubtotal()

Removes subtotals from a list.

void RemoveSubtotal()

Replace(object, object, ReplaceOptions)

Search in formulas and replace. Using this method doesn't change either the selection or the active cell.

int Replace(object what, object replacement, ReplaceOptions options = null)

Parameters

what object

The string you want to search for.

replacement object

The replacement string.

options ReplaceOptions

The replace options.

Returns

int

Number of cells that was replaced.

Select()

Selects the object.

void Select()

Sort(IRange, SortOrder, SortOrientation, bool)

void Sort(IRange key, SortOrder order = SortOrder.Ascending, SortOrientation orientation = SortOrientation.Columns, bool caseSensitive = false)

Parameters

key IRange
order SortOrder
orientation SortOrientation
caseSensitive bool

Sort(SortOrientation, bool, params IValueSortField[])

Sorts the cells represented by this range according to the specified options.

void Sort(SortOrientation orientation = SortOrientation.Columns, bool caseSensitive = false, params IValueSortField[] keys)

Parameters

orientation SortOrientation

The orientation.

caseSensitive bool

if set to true [case sensitive].

keys IValueSortField[]

The SortFieldBase array.

SpecialCells(SpecialCellType, SpecialCellsValue?)

Gets a IRange object that represents all the cells that match the specified type and value.

IRange SpecialCells(SpecialCellType type, SpecialCellsValue? value = null)

Parameters

type SpecialCellType

The cells to include.

value SpecialCellsValue?

If Type is either Constants or Formulas, this argument is used to determine which types of cells to include in the result. These values can be added together to return more than one type. The default is to select all constants or formulas, no matter what the type.

Returns

IRange

Returns a IRange object that represents all the cells that match the specified type and value.

Subtotal(int, ConsolidationFunction, IEnumerable<int>, bool, bool, SummaryRow)

Creates subtotals for the range.

void Subtotal(int groupBy, ConsolidationFunction subtotalFunction, IEnumerable<int> totalList, bool replace = true, bool pageBreaks = false, SummaryRow summaryRowLocation = SummaryRow.Below)

Parameters

groupBy int

The field to group by, as a one-based integer offset.

subtotalFunction ConsolidationFunction

The subtotal function.

totalList System.Collections.Generic.IEnumerable<T><int>

An array of 1-based field offsets, indicating the fields to which the subtotals are added.

replace bool

True to replace existing subtotals. The default value is True.

pageBreaks bool

True to add page breaks after each group. The default value is False.

summaryRowLocation SummaryRow

Places the summary data relative to the subtotal.

ToImage(Stream, ImageType, ImageSaveOptions)

Saves the range to the specified image stream using options.

void ToImage(Stream stream, ImageType imageType, ImageSaveOptions options)

Parameters

stream System.IO.Stream

The output image stream.

imageType ImageType

Specifies the type of image to create.

options ImageSaveOptions

The options for output image.

ToImage(Stream, ImageType)

Saves the range to the specified image stream.

void ToImage(Stream stream, ImageType imageType)

Parameters

stream System.IO.Stream

The output image stream.

imageType ImageType

Specifies the type of image to create.

ToImage(string, ImageSaveOptions)

Saves the range to the specified image file using options.

void ToImage(string imageFile, ImageSaveOptions options)

Parameters

imageFile string

The output image file.

options ImageSaveOptions

The options for output image.

ToImage(string)

Saves the range to the specified image file.

void ToImage(string imageFile)

Parameters

imageFile string

The output image file.

ToJson()

Generates a JSON string from the range.

string ToJson()

Returns

string

the JSON string that contains range info.

Ungroup()

Decrements the OutlineLevel of the specified rows or columns.

void Ungroup()

Union(IRange)

Returns an IRange object that represents the union of two ranges.
If range2 is from a different worksheet, an exception is thrown.

IRange Union(IRange range2)

Parameters

range2 IRange

The range to union with this range.

Returns

IRange

A new range which consists of the union of this range and range2.

Union(params IRange[])

Returns an IRange object that represents the union of several ranges.
If one or more ranges from a different worksheet are specified, an exception is thrown.

IRange Union(params IRange[] ranges)

Parameters

ranges IRange[]

Other ranges to union with this range.

Returns

IRange

A new range which consists of the union of this range and other ranges.

UnMerge()

Converts merged cells in the represented range to normal cells.

void UnMerge()