TX Sheet Control

SearchMatch Interface

Interface

Detached search match with its sheet identity and matched source text.

Package: @txtextcontrol/tx-sheet-control-server. Version: 2.0.0.

Related workbook object-model type, returned through the server control. Obtain it from its owning workbook or collection; it is not a required browser-package import.

Members

Properties

PropertyDescription
addressThe address value of SearchMatch.
indexThe index value of SearchMatch.
lengthThe length value of SearchMatch.
sheetIdThe sheetId value of SearchMatch.
sheetNameThe sheetName value of SearchMatch.
textThe text value of SearchMatch.

Examples

Create sample data and obtain this detached result from the owning document. Return the selected data to the report or application UI.

import type { ServerSheetControl } from '@txtextcontrol/tx-sheet-control-server';

function createSearchMatchReport(control: ServerSheetControl) {
    const book = control.workbook;
    const sheet = book.sheets.at(0);
    sheet.range('A7:D9').setValues([
        ['Description', 'Quantity', 'UnitPrice', 'Amount'],
        ['Consulting', 3, 120, 360],
        ['Training', 2, 90, 180],
    ]);

    const table = sheet.tables.add('InvoiceLines', 'A7:D9', {
        style: 'TableStyleMedium2',
        hasHeaderRow: true,
        showRowStripes: true,
    });

    const result = book.search.find({ query: 'Consulting' })[0];
    return result;
}

See Also