TX Sheet Control

DrawingGroup 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. DocumentObject
  2. DrawingGroup

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

Syntax

public class DrawingGroup

Members

Properties

PropertyDescription
Id

Methods

MethodDescription
BringForwardAsyncPerforms an operation on this document without activating another worksheet.
BringToFrontAsyncPerforms an operation on this document without activating another worksheet.
CopyToAsyncPerforms an operation on this document without activating another worksheet.
GetMembersAsyncPerforms an operation on this document without activating another worksheet.
GetSizeAsyncPerforms an operation on this document without activating another worksheet.
MoveToAsyncPerforms an operation on this document without activating another worksheet.
RemoveAsyncPerforms an operation on this document without activating another worksheet.
ResizeAsyncPerforms an operation on this document without activating another worksheet.
RotateAsyncPerforms an operation on this document without activating another worksheet.
SendBackwardAsyncPerforms an operation on this document without activating another worksheet.
SendToBackAsyncPerforms an operation on this document without activating another worksheet.
UngroupAsyncPerforms 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[]> CreateDrawingGroupReportAsync(ServerSheetControl control)
{
    var book = control.Workbook;
    var sheet = await book.Sheets.AtAsync(0);
    var drawing = await sheet.Drawings.AddShapeAsync(new { type = "rectangle", name = "Invoice heading", text = "Invoice", anchor = new { cell = "F2" }, size = new { width = 240, height = 80 }, fill = "#e5eef4" });
    var second = await sheet.Drawings.AddShapeAsync(new { type = "rectangle", name = "Invoice badge", anchor = new { cell = "H5" } });
    var drawingGroup = await sheet.Drawings.GroupAsync([drawing, second]);
    return await control.SaveAsync(StreamType.PDF);
}

See Also