TX Sheet Control

ServerSheetControlException 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. Exception
  2. ServerSheetControlException

Worksheet-scoped server API contract; requests retain document identity and cancellation semantics.

Syntax

public class ServerSheetControlException

Interfaces: ISerializable.

Members

Constructors

ConstructorDescription
Constructor

Properties

PropertyDescription
Code

Examples

Convert an application-supplied workbook and return a structured failure to the caller. Missing or invalid licenses fail; configure a valid signed token before retrying.

using TXTextControl.TXSheetControl.Server;

async Task<(byte[]? Pdf, string? Error)> TryConvertInvoiceAsync(byte[] workbookBytes, string signedLicense)
{
    try
    {
        await using var control = new ServerSheetControl(new ServerSheetControlOptions { License = signedLicense });
        await control.LoadAsync(workbookBytes, StreamType.SpreadsheetML);
        return (await control.SaveAsync(StreamType.PDF), null);
    }
    catch (ServerSheetControlException error)
    {
        return (null, error.Code + ": " + error.Message);
    }
}

See Also