SheetPrint 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 - Sheet
Print
- Document
Worksheet-scoped server API contract; requests retain document identity and cancellation semantics.
Syntax
public class SheetPrint
Members
Methods
| Method | Description |
|---|---|
| ConfigureAsync | Performs an operation on this document without activating another worksheet. |
| GetSettingsAsync | Performs an operation on this document without activating another worksheet. |
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[]> CreateSheetPrintReportAsync(ServerSheetControl control)
{
var book = control.Workbook;
var sheet = await book.Sheets.AtAsync(0);
await sheet.Range("A7:D9").SetValuesAsync(new object?[][]
{
[],
[],
[]
});
var table = await sheet.Tables.AddAsync("InvoiceLines", "A7:D9", new TableOptions { Style = "TableStyleMedium2", ShowRowStripes = true });
var sheetPrint = sheet.Print;
await sheetPrint.ConfigureAsync(new { orientation = "landscape", paperSize = 9 });
return await control.SaveAsync(StreamType.PDF);
}