TX Sheet Control

Cell Class

Class
Namespace
TXTextControl.TXSheetControl.Server
Package
TXTextControl.TXSheetControl.Server from the private NuGet feed or the supplied NuGet folder
Assembly
TXTextControl.TXSheetControl.Api.dll
Install
dotnet add package TXTextControl.TXSheetControl.Server .NET 10 and later.
Also in
TXTextControl.TXSheetControl.Blazor as TXTextControl.TXSheetControl.Api.dll
Inherits
  1. DocumentObject
  2. Range
  3. Cell

A worksheet-bound cell handle separating literal text, formulas, values, formatting and pictures.

Syntax

public class Cell

Members

Properties

PropertyDescription
Comments

Methods

MethodDescription
FormatTextAsyncZero-based UTF-16 string offsets; applies only to literal text.
GetCellTypeAsyncReads the detached interactive cell configuration.
GetDisplayStyleAsyncPerforms an operation on this document without activating another worksheet.
GetDisplayTextAsyncReads visible cell text using the server document's locale and number format.
GetFormulaAsyncPerforms an operation on this document without activating another worksheet.
GetHyperlinkAsyncReads the detached safe hyperlink target and optional display metadata.
GetInputAsyncReads the entered cell content independently of number formatting and calculation.
GetNoteAsyncReads the detached legacy note, or null when absent.
GetPictureAsyncPerforms an operation on this document without activating another worksheet.
GetRichTextAsyncReads detached text runs whose omitted font properties inherit the cell style.
GetStyleAsyncPerforms an operation on this document without activating another worksheet.
GetValueAsyncReads the calculated typed scalar from the owning worksheet.
RemovePictureAsyncPerforms an operation on this document without activating another worksheet.
SetCellTypeAsyncSets or clears portable interactive-cell settings, retaining content and existing formatting.
SetFormulaAsyncWrites an explicit formula; the leading equals sign is required.
SetHyperlinkAsyncSets or removes a hyperlink; unsafe URL schemes are rejected by the shared model.
SetInputAsyncParses entered content using the same input rules as the JavaScript editor.
SetNoteAsyncWrites or clears a legacy note using the current userName as its author.
SetNoteBoundsAsyncSets or clears the existing note's unzoomed bounds in one undoable operation, preserving its author and text.
SetPictureAsyncPerforms an operation on this document without activating another worksheet.
SetRichTextAsyncReplaces the cell value with literal text runs; strings are never parsed as formulas.
SetTextAsyncWrites literal text, preserving leading zeros and leading equals signs.
SetValueAsyncWrites a literal JSON scalar without parsing string values as formulas.

Examples

Build a small report using this document API and return its PDF bytes. Pass a live control with a fresh workbook; the caller owns its lifetime.

using TXTextControl.TXSheetControl.Server;

async Task<byte[]> CreateCellReportAsync(ServerSheetControl control)
{
    var book = control.Workbook;
    var sheet = await book.Sheets.AtAsync(0);
    var title = sheet.Cell("A1");
    await title.SetTextAsync("October invoice");
    await title.FormatAsync(new { fontFamily = "Liberation Sans", fontSize = 16, bold = true, textColor = "#ffffff", fillColor = "#163b63" });
    await sheet.Columns.At(0).SetWidthAsync(new { pixels = 240 });
    return await control.SaveAsync(StreamType.PDF);
}

See Also