Back to Devexpress

Spreadsheet Shapes

officefileapi-120692-spreadsheet-document-api-charts-and-graphics-shapes.md

latest5.2 KB
Original Source

Spreadsheet Shapes

  • Apr 15, 2025
  • 2 minutes to read

The Spreadsheet Document API library allows you to add shapes to a worksheet, adjust their fill and outline settings, connect and group shapes, create a shape text, or remove shapes from a document. You can print and export documents that contain shapes to PDF/HTML. All shape types are available: from simple lines and rectangles, to 3-D shapes with advanced effects.

Shape API

An individual shape (Shape) is a member of the Worksheet.Shapes collection. The ShapeCollection collection stores all drawing objects embedded in a worksheet (shapes, pictures, and charts). You can access an existing shape by its index in the shape collection or using the ShapeCollection.GetShapeById method. The Shape.ShapeType property allows you to distinguish between different drawing object types within a worksheet.

The ShapeCollection and Shape interfaces contain methods and properties designed to manipulate shapes in a document.

MemberDescriptionExample
ShapeCollection.AddShapeCreates a shape.How to: Create a Shape
ShapeCollection.AddTextBoxCreates a text box.How to: Add Text to a Shape
Shape.ShapeGeometrySpecifies a shape’s geometry.How to: Create a Shape
ShapeCollection.GroupShapesCreates a group of shapes.How to: Create a Shape Group
ShapeCollection.UngroupShapesSplits a shape group into individual shapes.How to: Create a Shape Group
ShapeCollection.AddConnectorCreates a connector.How to: Create a Shape Connector
Shape.ConnectorFormatObtains connector settings.How to: Create a Shape Connector
Shape.ShapeTextObtains shape’s text format settings.How to: Add Text to a Shape
ShapeText.CharactersAllows you to add text to a shape and specify its font characteristics and paragraph properties.How to: Add Text to a Shape
ShapeFormatBase.FillRetrieves shape’s fill options.How to: Change Shape’s Fill and Outline Color
ShapeFormatBase.OutlineObtains options used to format a shape’s outline.How to: Change Shape’s Fill and Outline Color
ShapeCollection.RemoveAt
Shape.DeleteRemoves a shape from a worksheet.How to: Remove a Shape

See Also

Charts and Graphics

Shape Examples