IXlCell Interface

Represents a single cell in a worksheet.

Namespace: DevExpress.Export.Xl

Assembly: DevExpress.Printing.v21.1.Core.dll

Declaration

public interface IXlCell :
    IDisposable

The following members accept/return IXlCell objects:

Remarks

Cells are constituent elements of a worksheet. An individual cell is represented by the object that implements the IXlCell interface. To create a worksheet cell, use the IXlRow.CreateCell method.

Each cell holds a single piece of data - the cell value. To get access to a cell value, use the IXlCell.Value property.

A cell can also contain a formula that calculates the cell value dynamically. To specify a cell formula, use the IXlCell.SetFormula method .

You can format cells to improve worksheet appearance. To do this, use the IXlCell.ApplyFormatting method or the IXlCell.Formatting property. For details on how to create, manage and format worksheet cells, see the Cells and Formatting sections of examples.

Example

The example below demonstrates how to create worksheet cells and set their values. To add data to a cell, assign the required value to the IXlCell.Value property.

// Create a new worksheet.
using (IXlSheet sheet = document.CreateSheet()) {
    // Create the first row in a worksheet.
    using (IXlRow row = sheet.CreateRow()) {

        // Create the cell A1 and specify its value. 
        using (IXlCell cell = row.CreateCell()) {
            cell.Value = "Numeric value:";
        }

        // Create the cell B1 and specify its value.
        using (IXlCell cell = row.CreateCell()) {
            cell.Value = 123.45;
        }
    }
}
See Also