Cell Class
- Namespace
TXTextControl.TXSheetControl. Server
- Package
TXTextControl.from the private NuGet feed or the supplied NuGet folderTXSheetControl. Server
- Assembly
TXTextControl.TXSheetControl. Api. dll
- Install
dotnet add package TXTextControl..NET 10 and later.TXSheetControl. Server
- Also in
TXTextControl.asTXSheetControl. Blazor TXTextControl.TXSheetControl. Api. dll
- Inherits
A worksheet-bound cell handle separating literal text, formulas, values, formatting and pictures.
Syntax
public class Cell
Members
Properties
| Property | Description |
|---|---|
| Comments |
Methods
| Method | Description |
|---|---|
| FormatTextAsync | Zero-based UTF-16 string offsets; applies only to literal text. |
| GetCellTypeAsync | Reads the detached interactive cell configuration. |
| GetDisplayStyleAsync | Performs an operation on this document without activating another worksheet. |
| GetDisplayTextAsync | Reads visible cell text using the server document's locale and number format. |
| GetFormulaAsync | Performs an operation on this document without activating another worksheet. |
| GetHyperlinkAsync | Reads the detached safe hyperlink target and optional display metadata. |
| GetInputAsync | Reads the entered cell content independently of number formatting and calculation. |
| GetNoteAsync | Reads the detached legacy note, or null when absent. |
| GetPictureAsync | Performs an operation on this document without activating another worksheet. |
| GetRichTextAsync | Reads detached text runs whose omitted font properties inherit the cell style. |
| GetStyleAsync | Performs an operation on this document without activating another worksheet. |
| GetValueAsync | Reads the calculated typed scalar from the owning worksheet. |
| RemovePictureAsync | Performs an operation on this document without activating another worksheet. |
| SetCellTypeAsync | Sets or clears portable interactive-cell settings, retaining content and existing formatting. |
| SetFormulaAsync | Writes an explicit formula; the leading equals sign is required. |
| SetHyperlinkAsync | Sets or removes a hyperlink; unsafe URL schemes are rejected by the shared model. |
| SetInputAsync | Parses entered content using the same input rules as the JavaScript editor. |
| SetNoteAsync | Writes or clears a legacy note using the current userName as its author. |
| SetNoteBoundsAsync | Sets or clears the existing note's unzoomed bounds in one undoable operation, preserving its author and text. |
| SetPictureAsync | Performs an operation on this document without activating another worksheet. |
| SetRichTextAsync | Replaces the cell value with literal text runs; strings are never parsed as formulas. |
| SetTextAsync | Writes literal text, preserving leading zeros and leading equals signs. |
| SetValueAsync | Writes 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
GetBarcodeAsync — Reads detached settings, or null when the cell has no barcode.
SetBarcodeAsync — Sets a barcode while retaining the cell value or formula. Pass null to remove only the barcode.