[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IWorksheet

Interface IWorksheet

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

Represents a worksheet.

public interface IWorksheet

Properties

ActiveCell

Gets the active cell.

IRange ActiveCell { get; }

Property Value

IRange

ActivePane

Returns the IPane object that represents the active pane of the worksheet.

IPane ActivePane { get; }

Property Value

IPane

AutoFilter

Returns an IAutoFilter object if filtering is on. Returns nothing if filtering is off (read-only).

IAutoFilter AutoFilter { get; }

Property Value

IAutoFilter

AutoFilterMode

Gets or sets whether the AutoFilter drop-down arrows are currently displayed on the sheet. This property is independent of the AutoFilterMode property (read or write).

bool AutoFilterMode { get; set; }

Property Value

bool

AutoGenerateColumns

Gets or sets whether to generate columns automatically while binding data.

bool AutoGenerateColumns { get; set; }

Property Value

bool

BackgroundPicture

Gets or sets the background graphic for a worksheet.

byte[] BackgroundPicture { get; set; }

Property Value

byte[]

BackgroundPictures

Returns a IBackgroundPictures object that represents all the backgound pictures on the worksheet or chart sheet (read-only).

IBackgroundPictures BackgroundPictures { get; }

Property Value

IBackgroundPictures

Cells

Returns the IRange object that represents all the cells on the worksheet (not just the cells that are currently in use). This object is read-only.

IRange Cells { get; }

Property Value

IRange

CellType

Gets or sets the cell type for current sheet.

BaseCellType CellType { get; set; }

Property Value

BaseCellType

ColumnCount

Gets or sets the column count of the worksheet when exported to JSON.

int ColumnCount { get; set; }

Property Value

int

Columns

Returns the IRange object that represents all the columns on the specified worksheet (read-only).

IRange Columns { get; }

Property Value

IRange

Comments

Returns the IComments collection that represents all the comments for the specified worksheet (read-only).

IComments Comments { get; }

Property Value

IComments

CommentsThreaded

Returns the ICommentsThreaded collection that represents all the threaded comments for the specified worksheet (read-only).

ICommentsThreaded CommentsThreaded { get; }

Property Value

ICommentsThreaded

Controls

Gets the control collection of this worksheet.

IControlCollection Controls { get; }

Property Value

IControlCollection

DataSource

Gets or sets the data source of data binding for current sheet.

object DataSource { get; set; }

Property Value

object

FilterMode

Gets whether the worksheet is in filter mode (read-only).

bool FilterMode { get; }

Property Value

bool

FixedPageBreaks

Gets or sets whether the horizontal and vertical page breaks are fixed when inserting/deleting rows/columns.

bool FixedPageBreaks { get; set; }

Property Value

bool

FreezeColumn

Gets the frozen column.

int FreezeColumn { get; }

Property Value

int

FreezeRow

Gets the frozen row.

int FreezeRow { get; }

Property Value

int

FreezeTrailingColumn

Gets the number of trailing frozen columns of the sheet.

int FreezeTrailingColumn { get; }

Property Value

int

FreezeTrailingRow

Gets the number of trailing frozen rows of the sheet.

int FreezeTrailingRow { get; }

Property Value

int

FrozenLineColor

Gets or sets the color of frozen line.

Color FrozenLineColor { get; set; }

Property Value

System.Drawing.Color

HPageBreaks

Get the collection of horizontal page breaks within the print area.

IHPageBreaks HPageBreaks { get; }

Property Value

IHPageBreaks

Provides access to the collection of Hyperlinks contained in the worksheet.

IHyperlinks Hyperlinks { get; }

Property Value

IHyperlinks

Index

Gets or sets the index number of the object within the collection of similar objects.

int Index { get; set; }

Property Value

int

Name

Gets or sets the name of the object (read or write).

string Name { get; set; }

Property Value

string

Names

Returns the INames collection that represents all the worksheet-specific names (names defined with the "WorksheetName!" prefix). This is a read-only Names object.

INames Names { get; }

Property Value

INames

Outline

Returns an IOutline object that represents the outline for the specified worksheet (read-only).

IOutline Outline { get; }

Property Value

IOutline

OutlineColumn

Gets the outline column for the worksheet.

IOutlineColumn OutlineColumn { get; }

Property Value

IOutlineColumn

PageSetup

Returns a PageSetup object that contains all the page setup settings for the specified object.

IPageSetup PageSetup { get; }

Property Value

IPageSetup

Panes

Worksheet panes.

IPanes Panes { get; }

Property Value

IPanes

PivotTables

Returns an object that represents either a single PivotTable report (a IPivotTables object) or a collection of all the PivotTable reports (IPivotTables object) on a worksheet (read-only).

IPivotTables PivotTables { get; }

Property Value

IPivotTables

Protection

Gets or sets the protection status of the worksheet.

bool Protection { get; set; }

Property Value

bool

ProtectionSettings

Returns the IProtectionSettings object that represents the protection options of the worksheet.

IProtectionSettings ProtectionSettings { get; }

Property Value

IProtectionSettings

Range

Returns an instance of IRange which provides access to cell values, formulas, formatting and other cell properties and methods.

IRangeProvider Range { get; }

Property Value

IRangeProvider

RowCount

Gets or sets the row count of the worksheet when exported to JSON.

int RowCount { get; set; }

Property Value

int

Rows

Returns the IRange object that represents all the rows on the specified worksheet. This is read-only Range object.

IRange Rows { get; }

Property Value

IRange

Selection

Gets the selection range.

IRange Selection { get; }

Property Value

IRange

Shapes

Returns a IShapes object that represents all the shapes on the worksheet or chart sheet (read-only).

IShapes Shapes { get; }

Property Value

IShapes

SheetView

Returns an object that represents the view settings of this worksheet(read-only).

IWorksheetView SheetView { get; }

Property Value

IWorksheetView

ShowColumnOutline

Gets or sets whether to display the column outline. The default value is true, and this property only applies when interacting with SJS.

bool ShowColumnOutline { get; set; }

Property Value

bool

ShowRowOutline

Gets or sets whether to display the row outline. The default value is true, and this property only applies when interacting with SJS.

bool ShowRowOutline { get; set; }

Property Value

bool

Sort

Returns the sorted values in the current worksheet (read-only).

ISort Sort { get; }

Property Value

ISort

SplitColumn

Gets the split column.

int SplitColumn { get; }

Property Value

int

SplitRow

Gets the split row.

int SplitRow { get; }

Property Value

int

StandardHeight

Gets or sets the standard (default) height(in points) of all the rows in the worksheet (read-only).

double StandardHeight { get; set; }

Property Value

double

StandardHeightInPixel

Gets or sets the standard (default) height(in pixels) of all the rows in the worksheet (read-only).

double StandardHeightInPixel { get; set; }

Property Value

double

StandardWidth

Gets or sets the standard (default) width(in points) of all the columns in the worksheet (read or write).

double StandardWidth { get; set; }

Property Value

double

StandardWidthInPixel

Gets or sets the standard (default) width(in pixels) of all the columns in the worksheet (read or write).

double StandardWidthInPixel { get; set; }

Property Value

double

TabColor

Gets or sets the primary color of the tab.

Color TabColor { get; set; }

Property Value

System.Drawing.Color

Tables

Returns a collection of ITable objects in the worksheet. This is a read-only ListObjects collection.

ITables Tables { get; }

Property Value

ITables

Tag

Gets or sets the tag for current sheet.

object Tag { get; set; }

Property Value

object

Type

Gets the sheet's type.

SheetType Type { get; }

Property Value

SheetType

UsedRange

Returns the IRange object that represents the used range on the specified worksheet, its behavior is equivalent to GetUsedRange(UsedRangeType.Axis | UsedRangeType.Data | UsedRangeType.Comment | UsedRangeType.Style | UsedRangeType.Merge)

IRange UsedRange { get; }

Property Value

IRange

Visible

Determines whether the object is visible (read or write Visibility).

Visibility Visible { get; set; }

Property Value

Visibility

VPageBreaks

Get the collection of vertical page breaks within the print area.

IVPageBreaks VPageBreaks { get; }

Property Value

IVPageBreaks

Workbook

Returns the workbook.

IWorkbook Workbook { get; }

Property Value

IWorkbook

Methods

Activate()

Makes the current sheet the active sheet. This is equivalent to clicking the sheet's tab.

void Activate()

Copy(IWorkbook)

Copies the sheet to the end of the specified workbook.

IWorksheet Copy(IWorkbook workbook = null)

Parameters

workbook IWorkbook

Specifies the workbook to which the sheet will be copied. If missing, the sheet will be copied to the current workbook.

Returns

IWorksheet

The new copied sheet.

CopyAfter(IWorksheet)

Copies the sheet to the location after the specified sheet.

IWorksheet CopyAfter(IWorksheet targetSheet)

Parameters

targetSheet IWorksheet

The sheet after which the copied sheet will be placed. It can be the sheet of the same or another workbook.

Returns

IWorksheet

The new copied sheet.

CopyBefore(IWorksheet)

Copies the sheet to the location before the specified sheet.

IWorksheet CopyBefore(IWorksheet targetSheet)

Parameters

targetSheet IWorksheet

The sheet before which the copied sheet will be placed. It can be the sheet of the same or another workbook.

Returns

IWorksheet

The new copied sheet.

Delete()

Deletes the object.

void Delete()

Evaluate(string, IFormulaResolver)

object Evaluate(string formula, IFormulaResolver resolver)

Parameters

formula string
resolver IFormulaResolver

Returns

object

Evaluate(string)

Converts a Microsoft Excel name to an object or a value.

object Evaluate(string formula)

Parameters

formula string

Required String. The name of the object, using the naming convention.

Returns

object

FreezePanes(int, int)

Freezes panes at the specified position.

void FreezePanes(int row, int column)

Parameters

row int

The frozen row position.

column int

The frozen column position.

FreezeTrailingPanes(int, int)

Freezes trailing panes at the specified position.

void FreezeTrailingPanes(int row, int column)

Parameters

row int

The trailing frozen row position.

column int

The trailing frozen column position.

FromJson(Stream, DeserializationOptions)

Generates a worksheet from the JSON stream.

void FromJson(Stream stream, DeserializationOptions deserializationOptions = null)

Parameters

stream System.IO.Stream

the input JSON stream.

deserializationOptions DeserializationOptions

the DeserializationOptions object.

FromJson(string, DeserializationOptions)

Generates a worksheet from the JSON string.

void FromJson(string json, DeserializationOptions deserializationOptions = null)

Parameters

json string

the input JSON string.

deserializationOptions DeserializationOptions

the DeserializationOptions object.

GetUsedRange(UsedRangeType)

Gets the used range.

IRange GetUsedRange(UsedRangeType type = UsedRangeType.All)

Parameters

type UsedRangeType

The feature type.

Returns

IRange

Move(IWorkbook)

Moves the sheet to the end of the specified workbook.

IWorksheet Move(IWorkbook workbook = null)

Parameters

workbook IWorkbook

Specifies the workbook to which the sheet will be moved. If missing, the sheet will be moved to the current workbook.

Returns

IWorksheet

The moved sheet.

MoveAfter(IWorksheet)

Moves the sheet to the location after the specified sheet.

IWorksheet MoveAfter(IWorksheet targetSheet)

Parameters

targetSheet IWorksheet

The sheet after which the moved sheet will be placed. It can be the sheet of the same or another workbook.

Returns

IWorksheet

The moved sheet.

MoveBefore(IWorksheet)

Moves the sheet to the location before the specified sheet.

IWorksheet MoveBefore(IWorksheet targetSheet)

Parameters

targetSheet IWorksheet

The sheet before which the moved sheet will be placed. It can be the sheet of the same or another workbook.

Returns

IWorksheet

The moved sheet.

PrintOut(PrintOutOptions)

Prints the worksheet.

void PrintOut(PrintOutOptions options = null)

Parameters

options PrintOutOptions

Options for printing the worksheet.

Protect(string)

Protects a worksheet so that it cannot be modified.

void Protect(string password = null)

Parameters

password string

Password to protect the worksheet.

Save(Stream, SaveFileFormat)

Saves current worksheet to the specified format file stream.

void Save(Stream fileStream, SaveFileFormat fileFormat)

Parameters

fileStream System.IO.Stream

The specified file stream.

fileFormat SaveFileFormat

The format of the file stream.

Save(Stream, SaveOptionsBase)

Saves current worksheet to the specified file stream.

void Save(Stream fileStream, SaveOptionsBase options)

Parameters

fileStream System.IO.Stream

The specified file stream.

options SaveOptionsBase

The options of saving the file stream.

Save(string, SaveFileFormat)

Saves current worksheet to the specified format file.

void Save(string fileName, SaveFileFormat fileFormat)

Parameters

fileName string

The specified file.

fileFormat SaveFileFormat

The format of the file.

Save(string, SaveOptionsBase)

Saves current worksheet to the specified file.

void Save(string fileName, SaveOptionsBase options)

Parameters

fileName string

The specified file.

options SaveOptionsBase

The options of saving the file.

Save(string)

Saves current worksheet to file.

void Save(string fileName)

Parameters

fileName string

The specified file name.

Select(bool)

Selects the object.

void Select(bool replace = true)

Parameters

replace bool

True to replace the current selection with the specified object. False to extend the current selection to include any previously selected objects and the specified object.

ShowAllData()

Makes all rows of the currently filtered list visible. If AutoFilter is in use, this method changes the arrows to "All."

void ShowAllData()

SplitPanes(int, int)

Splits panes at the specified position.

void SplitPanes(int row, int column)

Parameters

row int

The split row position.

column int

The split column position.

ToImage(Stream, ImageType, ImageSaveOptions)

Saves the worksheet to the specified image stream using options.

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

Parameters

stream System.IO.Stream

The specified image stream.

imageType ImageType

Specifies the type of image to create.

options ImageSaveOptions

The options for output image.

ToImage(Stream, ImageType)

Saves the worksheet to the specified image stream.

void ToImage(Stream stream, ImageType imageType)

Parameters

stream System.IO.Stream

The specified image stream.

imageType ImageType

Specifies the type of image to create.

ToImage(string, ImageSaveOptions)

Saves the worksheet 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 worksheet to the specified image file.

void ToImage(string imageFile)

Parameters

imageFile string

The output image file.

ToJson(SerializationOptions)

Generates a JSON string from the worksheet.

string ToJson(SerializationOptions serializationOptions = null)

Parameters

serializationOptions SerializationOptions

the SerializationOptions object.

Returns

string

ToJson(Stream, SerializationOptions)

Generates a JSON stream from a worksheet.

void ToJson(Stream stream, SerializationOptions serializationOptions = null)

Parameters

stream System.IO.Stream

The specified JSON stream.

serializationOptions SerializationOptions

the SerializationOptions object.

UnfreezePanes()

Unfreezes panes.

void UnfreezePanes()

UnfreezeTrailingPanes()

Unfreezes trailing panes.

void UnfreezeTrailingPanes()

Unprotect(string)

Removes protection from the worksheet.

void Unprotect(string password = null)

Parameters

password string

Password to protect the worksheet.

UnsplitPanes()

Unsplits panes.

void UnsplitPanes()

Events

Activated

Occurs when the worksheet is activated.

event EventHandler Activated

Event Type

System.EventHandler

BeforeDelete

Occurs before the worksheet is deleted.

event EventHandler BeforeDelete

Event Type

System.EventHandler

Changed

Occurs when something changes in the cells.

event EventHandler<RangeEventArgs> Changed

Event Type

System.EventHandler<TEventArgs><RangeEventArgs>

Deactivated

Occurs when the worksheet is deactivated.

event EventHandler Deactivated

Event Type

System.EventHandler

SelectionChange

Occurs when the selection changes on a worksheet.

event EventHandler<RangeEventArgs> SelectionChange

Event Type

System.EventHandler<TEventArgs><RangeEventArgs>