![]() ![]() IWorksheet worksheet = workbook.Worksheets The method provides overloads which allow you to add variety of shapes at a specified position or to a specified range.Refer to the below example code to add shapes at a particular position and to a specific range: To add shapes in a GcExcel worksheet, you can use AddShape method of the IShapes interface. All the drawing objects including chart, comment, picture, slicer, general shape and shape group are defined as Shape.Ī name can also be assigned to a shape, be it a chart, picture, connector or any autoshape, by using different methods provided in IShapes interface. By assigning a name to a shape, it be directly accessed and its properties can be modified rather than traversing through the list of all shapes. ![]() In GcExcel, the Shapes collection represents the collection of shapes in a specified worksheet. ShapeĪ shape is a drawing object and a member of the Shapes collection. Note: One of the limitations of using connector format is that you can add a connector to connect two general shapes and export it but the connector will be shown only after you drag the shape to your spreadsheet. IShape rangeConnectorShape = (ConnectorType.Curve, worksheet.Range) Add connector for rectangle3 and rectangle4, by adding connector directly to a range IShape rectangle4 = (AutoShapeType.Rectangle, worksheet.Range) IShape rectangle3 = (AutoShapeType.Rectangle, worksheet.Range) To detach the ends of the connector to other shapes.Ĭ(shapeBegin, 3) Ĭ(endBegin, 0) IShape connectorShape = (ConnectorType.Straight, 1, 1, 101, 101) Add connector for shapeBegin and endShape, by providing connector position in points IShape endBegin = (AutoShapeType.Rectangle, 200, 200, 100, 100) IShape shapeBegin = (AutoShapeType.Rectangle, 1, 1, 100, 100) ![]()
0 Comments
Leave a Reply. |