TX Sheet Control

Search 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. Search

Sparse workbook search and atomic replacement across inputs, formulas, values and displayed text.

Syntax

public class Search

Members

Methods

MethodDescription
FindAsyncReturns stable worksheet/row-major matches; maxResults is bounded to protect large workbooks.
ReplaceAsyncReplaces matching cells in one transaction; protection and validation are still enforced.

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[]> CreateSearchReportAsync(ServerSheetControl control)
{
    var book = control.Workbook;
    var sheet = await book.Sheets.AtAsync(0);
    await sheet.Cell("A1").SetTextAsync("Consulting");

    var search = book.Search;
    await search.ReplaceAsync(new SearchOptions { Query = "Consulting", Target = "text" }, "Consulting services");
    return await control.SaveAsync(StreamType.PDF);
}

See Also