Search 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
- Document
Object - Search
- Document
Sparse workbook search and atomic replacement across inputs, formulas, values and displayed text.
Syntax
public class Search
Members
Methods
| Method | Description |
|---|---|
| FindAsync | Returns stable worksheet/row-major matches; maxResults is bounded to protect large workbooks. |
| ReplaceAsync | Replaces 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);
}