TX Sheet Control

XlsxWarning Constructor

Constructor
Namespace
TXTextControl.TXSheetControl.Server
Package
TXTextControl.TXSheetControl.Server as TXTextControl.TXSheetControl.Api.dll from the private NuGet feed or the supplied NuGet folder
Also in
TXTextControl.TXSheetControl.Blazor as TXTextControl.TXSheetControl.Api.dll

Syntax

public XlsxWarning(string Code, string Message, string? Part)

Parameters

ParameterTypeOptionalDescription
CodestringNoValue matching Code's declared type and the owning object's validation rules.
MessagestringNoValue matching Message's declared type and the owning object's validation rules.
Partstring?NoValue matching Part's declared type and the owning object's validation rules.

Return Value

XlsxWarning.

Examples

Load a real XLSX file and build import notices for the application UI. A successful import can still report unsupported features; the array is empty for a clean conversion.

using TXTextControl.TXSheetControl.Server;

async Task<string[]> GetImportNoticesAsync(ServerSheetControl control, byte[] originalDocument)
{
    var loaded = await control.LoadAsync(originalDocument, StreamType.SpreadsheetML);
    var notices = loaded.Warnings.Select(notice => notice.Message).ToArray();
    return notices;
}

Remarks

Use the member with an instance or settings object from the documented package. Await task-returning operations. Document-bound handles must be resolved again after loading or deleting their owner.

See Also