# SearchOptions Class

> SearchOptions class in the TX Sheet Control .NET API: Sparse search settings shared with JavaScript. Targets are input, formula, value or displayText.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Namespace:** `TXTextControl.TXSheetControl.Server`
- **Package:** `TXTextControl.TXSheetControl.Server` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Package:** `TXTextControl.TXSheetControl.Blazor` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Implements:** `System.IEquatable<TXTextControl.TXSheetControl.Server.SearchOptions>`
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Server > SearchOptions Class
- **1360 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/searchoptions/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/searchoptions/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/searchoptions/llms-full.txt

---

Sparse search settings shared with JavaScript. Targets are input, formula, value or displayText.

### Syntax

```csharp
public class SearchOptions
```

Interfaces: `IEquatable<SearchOptions>`.

### Members

#### Constructors

| Constructor | Description |
|---|---|
| [Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/searchoptions/constructor/llms-full.txt) |  |

#### Properties

| Property | Description |
|---|---|
| [MatchCase](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/searchoptions/matchcase-property/llms-full.txt) |  |
| [MatchWholeCell](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/searchoptions/matchwholecell-property/llms-full.txt) |  |
| [MaxResults](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/searchoptions/maxresults-property/llms-full.txt) |  |
| [Query](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/searchoptions/query-property/llms-full.txt) |  |
| [Range](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/searchoptions/range-property/llms-full.txt) |  |
| [SheetId](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/searchoptions/sheetid-property/llms-full.txt) |  |
| [Target](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/searchoptions/target-property/llms-full.txt) |  |
| [UseRegularExpression](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/searchoptions/useregularexpression-property/llms-full.txt) |  |

### Examples

Apply SearchOptions to a small working document, then return the exported bytes. The caller can save or download the result.

```csharp
using TXTextControl.TXSheetControl.Server;

async Task<byte[]> CreateSearchOptionsReportAsync(ServerSheetControl control)
{
    var book = control.Workbook;
    var sheet = await book.Sheets.AtAsync(0);
    await sheet.Cell("B8").SetValueAsync(120);
    await sheet.Cell("B9").SetValueAsync(80);
    await sheet.Cell("B10").SetFormulaAsync("=SUM(B8:B9)");
    await sheet.Cell("A1").SetTextAsync("October invoice");
    await sheet.Cell("A1").FormatAsync(new { fontFamily = "Liberation Sans", fontSize = 16, bold = true, textColor = "#ffffff", fillColor = "#163b63" });
    await sheet.Range("B8:B10").FormatAsync(new { numberFormatCode = "#,##0.00", fontFamily = "Liberation Sans", fontSize = 11 });

    var settings = new SearchOptions()
    {
        MatchCase = false,
        MaxResults = 25,
        Query = "Consulting",
        Target = "displayText"
    };

    foreach (var match in await book.Search.FindAsync(settings))
    {
        var foundSheet = await book.Sheets.GetByIdAsync(match.SheetId);
        await foundSheet.Cell(match.Address).FormatAsync(new { fillColor = "#ffe699" });
    }

    return await control.SaveAsync(StreamType.PDF);
}
```

### See Also

- [TXTextControl.TXSheetControl.Server Namespace](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/llms-full.txt)
- [Workbooks and Worksheets](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/workbooks/llms-full.txt)

---

## In This Section

- [SearchOptions Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/searchoptions/constructor/llms-full.txt): SearchOptions constructor in the TX Sheet Control .NET API, with its syntax, a C# example and remarks on awaiting tasks and handles.
- [SearchOptions.MatchCase Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/searchoptions/matchcase-property/llms-full.txt): SearchOptions.MatchCase property in the TX Sheet Control .NET API, with its syntax, its type bool?, a C# example and remarks on awaiting tasks and handles.
- [SearchOptions.MatchWholeCell Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/searchoptions/matchwholecell-property/llms-full.txt): SearchOptions.MatchWholeCell property in the TX Sheet Control .NET API, with its syntax, its type bool? and a C# example.
- [SearchOptions.MaxResults Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/searchoptions/maxresults-property/llms-full.txt): SearchOptions.MaxResults property in the TX Sheet Control .NET API, with its syntax, its type int?, a C# example and remarks on awaiting tasks and handles.
- [SearchOptions.Query Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/searchoptions/query-property/llms-full.txt): SearchOptions.Query property in the TX Sheet Control .NET API, with its syntax, its type string, a C# example and remarks on awaiting tasks and handles.
- [SearchOptions.Range Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/searchoptions/range-property/llms-full.txt): SearchOptions.Range property in the TX Sheet Control .NET API, with its syntax, its type string?, a C# example and remarks on awaiting tasks and handles.
- [SearchOptions.SheetId Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/searchoptions/sheetid-property/llms-full.txt): SearchOptions.SheetId property in the TX Sheet Control .NET API, with its syntax, its type string?, a C# example and remarks on awaiting tasks and handles.
- [SearchOptions.Target Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/searchoptions/target-property/llms-full.txt): SearchOptions.Target property in the TX Sheet Control .NET API, with its syntax, its type string?, a C# example and remarks on awaiting tasks and handles.
- [SearchOptions.UseRegularExpression Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/searchoptions/useregularexpression-property/llms-full.txt): SearchOptions.UseRegularExpression property in the TX Sheet Control .NET API, with its syntax, its type bool? and a C# example.

---

## Nearby

- **Previous:** [SearchMatch.Text Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/searchmatch/text-property/llms-full.txt)
- **Next:** [SearchOptions Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/searchoptions/constructor/llms-full.txt)
