[]
        
(Showing Draft Content)

C1.Excel.XLSheet

XLSheet Class

Represents individual worksheets in an Excel workbook (C1XLBook).

Inheritance
XLSheet
Implements
Namespace: C1.Excel
Assembly: C1.Excel.dll
Syntax
public class XLSheet : ICloneable
Remarks

Provides indexers to get or set the value of individual cells (XLCell) and to access the Rows and Columns on the sheet.

Examples

Use the C1XLBookSheets indexer to get an individual sheet. For example, the code below gets a reference to the first sheet on the book, then prints the number of rows and columns on the sheet:

C1XLBook book = new C1XLBook();
XLSheet sheet = book.Sheets[0];
Debug.WriteLine("Sheet has {0} rows and {1} columns",
  sheet.Rows.Count, sheet.Columns.Count);

Properties

Name Description
Background

Gets or sets the background bitmap (image) of the XLSheet.

Book

Gets a reference to the C1XLBook that owns the sheet.

CodeName

Gets or sets the code name of the XLSheet. Is need for VBA operations.

ColumnMaxLevel

Gets maximum outline level for columns.

Columns

Gets a reference to sheet's column collection.

Comments

Gets an XLCommentCollection that contains the collection of comments that on the sheet.

ConditionalFormattings

Gets the collection of XLConditionalFormatting objects for the current workbook.

DataValidations

Gets the collection of XLDataValidation objects for the current workbook.

DefaultColumnWidth

Gets or sets the default column width for the sheet (in twips).

DefaultRowHeight

Gets or sets the default row height for the sheet (in twips).

GridColor

Gets or sets the color used to display grid lines.

this[int, int]

Gets the cell at a specified position on the sheet, creating a new cell if necessary.

Locked

Gets or sets a value that determines if the sheet is locked for editing.

MaxOutlineLevel

Gets the maximum subtotals outline level for rows or columns.

MergedCells

Gets an XLCellRangeCollection that contains the collection of cells that are merged on the sheet.

Name

Gets or sets the name of the XLSheet.

OutlinesBelow

Gets or sets a value indicating the vertical location of outline buttons.

OutlinesRight

Gets or sets a value indicating the horizontal location of outline buttons.

PageBreakPreview

Gets or sets whether Excel should show page break preview when displaying the sheet.

PrintSettings

Gets or sets an XLPrintSettings object that controls how the sheet is printed.

RowMaxLevel

Gets maximum outline level for rows.

Rows

Gets a reference to the sheet's row collection.

Scale

Gets or sets the view scale of this worksheet using percentages.

ScaleNormal

Gets or sets the view scale for normal view of this worksheet using percentages.

SelectedCells

Gets an XLCellRangeCollection that contains the collection of cells that are selected on the sheet.

Shapes

Gets a reference to the ShapeCollection for the sheet.

ShowGridLines

Gets or sets whether Excel should show the grid lines when displaying the sheet.

ShowHeaders

Gets or sets whether Excel should show the row and column headers when displaying the sheet.

ShowZeros

Gets or sets whether Excel should show the zero values on the sheet.

TabColor

Gets or sets the color used to display the tab of this sheet.

TotalsBelowData

Gets whether Excel should show the subtotals data when displaying the sheet.

ViewLayout

Gets or sets whether Excel should show view layout (preview) when displaying the sheet.

Visible

Gets or sets the sheet's visibility.

Methods

Name Description
Clone()

Creates a copy of this sheet.

CopyFormula(int, int, int, int)

Copies the formula from a source cell to a destination cell, adjusting relative references.

GetCell(int, int)

Gets a reference to a cell at the specified coordinates or null if the cell doesn't exist.

GetColumnWidth(int)

Calculation column width.

GetDefaultRowHeight(CompatibilityMode)

Gets a default row height value for each CompatibilityMode

GetFormattedText(int, int)

Gets formatted text is using XLStyle format value of the cell.

GetRangeToRepeat(out int, out int, out int, out int)

Returns a value indicating whether print titles are specified for this worksheet. (Print titles are rows repeated at top, and columns repeated at left of each page when the sheet is printed.) Output parameters indicate the indexes of title rows and columns.

GetRowHeight(int)

Calculation row height.

Load(Stream, bool)

Loads the Excel worksheet from a stream.

Load(string, bool)

Loads the Excel worksheet from a file.

LoadCsv(Stream)

Loads data from a stream containing comma-separated values (.csv) into the current sheet.

LoadCsv(string)

Loads data from a file containing comma-separated values (.csv) into the current sheet.

LoadCsvAsync(Stream)

Loads async data from a stream containing comma-separated values (.csv) into the current sheet.

LoadCsvAsync(string)

Loads async data from a file containing comma-separated values (.csv) into the current sheet.

SaveCsv(Stream)

Saves data from the current sheet into a comma-separated values (.csv) formatted stream.

SaveCsv(string)

Saves data from the current sheet into a comma-separated values (.csv) formatted file.

SaveCsvAsync(Stream)

Saves async data from the current sheet into a comma-separated values (.csv) formatted stream.

SaveCsvAsync(string)

Saves async data from the current sheet into a comma-separated values (.csv) formatted file storage.

SetRangeToRepeat(int, int, int, int)

Specifies the range of rows or/and columns to use as print titles for this worksheet. (Print titles are rows repeated at top, and columns repeated at left of each page when the sheet is printed.)